3 ms·
Since I wrote a string hash code function recently[1], I was interested to see what they use. Like many, they're using[2] the venerable djb hash. That sent me d
by munificent 12y ago
Since I wrote a string hash code function recently[1], I was interested to see what they use. Like many, they're using[2] the venerable djb hash. That sent me down a rabbit hole where I discovered that Bernstein was 19 when he wrote about it. Wow.
[1]: https://github.com/munificent/wren/blob/master/src/wren_value.c#L368-L382 https://github.com/munificent/wren/blob/master/src/wren_valu...
[2]: https://github.com/dotnet/coreclr/blob/master/src/mscorlib/src/System/String.cs#L798-L839 https://github.com/dotnet/coreclr/blob/master/src/mscorlib/s...