Hacker News new | past | comments | ask | show | jobs | submit login

i was able to find the xxhash core within 5 minutes, with no particular experience in xxhash or hashing algorithms.

1. google xxhash, click first result (github)

2. open xxhash.c

3. see it is mostly empty, go back and open xxhash.h. this file is 6k lines (not 20k), it probably has most or all of the implementation somewhere.

4. starting from top of file, read intro docs: "xxHash [...] is proposed in four flavors, in three families: 1. @ref XXH32_family: Classic 32-bit hash function." i will select XXH32 for illustration.

5. scroll down to examples, which calls "return XXH32(string, length, seed);"

6. ctrl-f "XXH32(", could be done in any text editor (even notepad)

7. press enter 6 times

8. see "@brief The implementation for @ref XXH32().", we have probably arrived at the core or reasonably close to it. if that didn't work, then I would try "XXH32 (", which would immediately find the XXH32 function.

of the 6k lines, about 550 are empty, about 2800 are comments, and about 800 are preprocessor directives. the comments appear to be mostly useful comments, not the "/* Frobnicate the bar. */ int Bar::frobnicate()" type which tend to be seen in IDE-overuse projects.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: