-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
v2 ideas #88
Comments
Any thoughts on adding non-cryptographic hashes? e.g.:
|
What would be the use case? |
In general non-cryptographic hashes give synchronize call which widely applicable.
Both In case of Footnotes |
Would be great to have a properly supported murmur3 hash for Kafka-like projects! |
Btw, I'm currently settle on
|
Quote from contributor about ESM transition: Got it, thank you for explaining the rationale! Might be worth considering that extended support for Node.js v18 will be provided for users of among others:
So for these users, Node.js v18 will not actually be deprecated during 2025 and some users will expect to keep using their supported runtime versions beyond the upstream maintenance window. Not meaning to imply that Footnotes
|
+1 to add md5 😉 |
md5 is available in |
Unrolled loops for SHA3 resulted in a 3.5x improvement on Hermes v0.12.0 on an Android Samsung A52. I assume the performance improvement wouldn't be quite as impactful on modern JS engines, but for older engines it might be worth having. |
@kewde is SHA3 a bottleneck for you? How are the other parts of your app? Do you do many sha3-s per second? |
We've been spending a bit of efforts on performance profiling our application. We do a lot of cryptographic operations, which is currently bottlenecking our startup time. The reality is that the underlying JavaScript engine (Hermes) is to blame for a lot of the bad performance but we can't simply swap out the engine for a more performant one at this moment in time. We moved from this unrolled keccak implementation: https://github.com/ExodusMovement/keccak/blob/exodus/lib/keccak-state-unroll.js to the one provided by noble hashes, the SHA3 operations used to take 109ms, with noble it is taking 350ms.
Mostly battling other cryptographic operations, one of the other things that has been a slowdown for us on this older version of Hermes are the noble elliptic libraries, the default window size of 8 results in a lot of points being precomputed. About 500ms for each curve on older Android phones. Reducing the window size to 2 - resulted in a much faster startup time for those devices.
Yes, we parse a bunch of solidity contracts, in order to compute the id of the methods, we need to SHA3 hash some bits and bobs. |
I've published unrolled version of noble-hashes sha3 in this package: https://www.npmjs.com/package/unrolled-nbl-hashes-sha3 You can use it for now from NPM (make sure to lock down dep version). |
Good to know, we should adjust docs. |
What about SipHash? |
Who uses it? |
I think he meant +1 to have it exported in the package so we can use it directly instead of copying the code from test/misc/md5.ts and make our own function. |
@Vexcited what do you use md5 for? |
Whenever the API I'm writing a library for requires an MD5 hash at some point. For example, today I wrote the following code to retrieve the key to decrypt an AES-CBC ciphertext from a service I want to write a wrapper for: const keychain: Array<Uint8Array> = [];
const saltedKey = concatBytes(this.key, hexToBytes(salt));
keychain.push(hexToBytes(md5(saltedKey)));
for (let i = 0; i < 3; i++) {
keychain.push(
hexToBytes(md5(concatBytes(
keychain.at(-1)!,
saltedKey
)))
);
} and had to find another library that also uses That's why I'd love to have this implemented in |
I need |
Understood. Maybe we should add it. |
Gravatar switched to sha256 https://docs.gravatar.com/api/avatars/hash/ 😉 |
@noble/hashes/sha3
to@noble/hashes/sha3.js
Maybe also:
The text was updated successfully, but these errors were encountered: