Skip to content
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

feat: add a new noble-based implementation #31

Merged
merged 1 commit into from
Nov 16, 2024

Conversation

ChALkeR
Copy link
Contributor

@ChALkeR ChALkeR commented Nov 15, 2024

Uses @noble/hashes as a polyfill in newer environments where it works

Also adds support for:
sha512-224, sha512-256, sha3-224, sha3-256, sha3-384, sha3-512, blake2b512 and blake2s256

Node.js-based default ./inde.js already supports those through Node.js/OpenSSL, so different support level shouldn't be an issue. Also, the old browser impl here doesn't limit sha.js list of supported hashes and the list depends on sha.js version / can change outside of this lib.

The new version is used only when the env supports BigInt and when importing noble-based implementation doesn't fail

So this should be compatible with all currently supported versions and be a semver-minor change

Test changes better viewed with whitespace ignored, I had to shift the whole existing test to run it on bold old and new implementations.

@ChALkeR ChALkeR changed the title feat: add a new noble-based implementation feat: add a new noble-based implementation when BigInt is available Nov 15, 2024
@ChALkeR ChALkeR changed the title feat: add a new noble-based implementation when BigInt is available feat: add a new noble-based implementation Nov 15, 2024
@ChALkeR ChALkeR force-pushed the chalker/noble/0 branch 11 times, most recently from eb53eec to e442cc6 Compare November 15, 2024 22:15
@ljharb ljharb force-pushed the chalker/noble/0 branch 3 times, most recently from b01a871 to 53fa3fa Compare November 16, 2024 20:59
@ljharb ljharb merged commit 53fa3fa into browserify:master Nov 16, 2024
382 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants