-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorporate suite of hash utilities into node #2444
Comments
It maybe a much shorter path to add an efficient wrapper for zlib crc32 library as per open issue 7213, However, I would still believe we should be a plan to add a suite of hash functions to node rather than just crc32. |
I don't think node core should be bloated with barely-known hash functions, especially if it requires adding another dependency. But exposing CRC32 from zlib would be logical. I kinda abandoned my previous PR because I preferred to not add CRC32 and Adler32 at all rather than add them to crypto, which has literally nothing to do with checksums. If we can reach agreement where checksum functions belong (I still vote for the zlib module), then I'll gladly rebase and resubmit that PR. |
exposing from zlib would be ok, I guess, though it seems unnecessary. generic crc is easily done as an addon. Mine is probably out of date, and needs to be rewritten with nan, but its here, and supports parameterized CRCs: https://github.com/sam-github/node-bcrc |
IMHO I think this should stay out of core. There's already lots of choices in CRC modules on npm and elsewhere, some are pure JS and some are addons (one of which is highly optimized for SSE, if you care about that). |
SIMD support is coming to V8. In 6 to 12 months time you will be able to write implementations that rival native code for speed. I don't think we have to add anything to core. User land and a little patience will sort it out. |
Closing this out, this probably belongs in userland. Let us know if there is anything specific you have trouble building or are unable to! |
I understand the direction, and thanks for your time to review. I have always been skeptical of native vs JS performance and a bit old school on this and I'm always concerned about gyp builds of native code for cross platform, especially windows. @bnoordhuis - SIMD in node sounds very interesting. Thanks for the info. |
Following the lead from this closed node.js request here and here, can we please look at the opportunity of adding support for non-crystallographic hash functions into the node core.
There are many usecases where hash functions (CRC or checksums) can be useful for non-crystallographic purposes and adding this will go a long way to extend the use of node.js as a general purpose desktop and server application development language.
To shorten the development effort, it may be best to include an existing cross platform, C or C++ based library that has an appropriate license which contains a wide range of hash functions. To this end, I have done some digging and found that one good candidate is the RHash Project. RHash appears to be small, popular, cross platform, and based on the MIT license. All of this may make RHash a good candidate for the backbone of a checksum library for node.
Regarding where to house checksum libraries, It can either be put under crypto, although this will likely raise some passionate discussion. Another suggestion is to create a new library called hash.
The text was updated successfully, but these errors were encountered: