It's been a little under a month since I submitted the initial bits of this: <a href="https://news.ycombinator.com/item?id=43730458">https://news.ycombinator.com/item?id=43730458</a><p>I was asked to upstream (which I tried to, it's the linked issue), and about additional functions.<p>Since then, the issue hasn't gained a lot of traction, but I implemented a few far more interesting algorithms, both by Wojciech Muła:<p>SIMDized check which bytes are in a set: <a href="http://0x80.pl/notesen/2018-10-18-simd-byte-lookup.html" rel="nofollow">http://0x80.pl/notesen/2018-10-18-simd-byte-lookup.html</a> (for strspn and strcspn).<p>SIMD-friendly algorithms for substring searching: <a href="http://0x80.pl/notesen/2016-11-28-simd-strfind.html" rel="nofollow">http://0x80.pl/notesen/2016-11-28-simd-strfind.html</a> (for strstr and memmem).<p>These basically "complete" the set of string.h methods.<p>I also made sure the header compiles with C++, added a bunch of tests, and made it easier to integrate in your stuff if even it doesn't get upstreamed.<p>If you're interested in diving into the code, this is a direct link:
<a href="https://github.com/ncruces/go-sqlite3/blob/main/sqlite3/libc/string.h">https://github.com/ncruces/go-sqlite3/blob/main/sqlite3/libc...</a>