Skip to content

support multi-byte wide typed arrays #78

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

Merged
merged 1 commit into from
Jul 1, 2025

Conversation

ChALkeR
Copy link
Contributor

@ChALkeR ChALkeR commented Dec 1, 2024

Same as: browserify/hash-base#19, browserify/cipher-base#23, but retains support for Array and Array-like objects, since this module isn't closely mimicking the Node.js API

For array-likes, coherence rechecks are added to ensure invalid results are not returned

On everything Node.js createHash works, this now should be compatible + additionally keeps array-like support

@ljharb
Copy link
Member

ljharb commented Dec 1, 2024

Looks like node < 8 doesn't support passing a typed array directly into .update

@ChALkeR
Copy link
Contributor Author

ChALkeR commented Dec 2, 2024

@ljharb yes, but newer versions do + this impl works regardless when proper new Uint8Array and ArrayBuffer.isView are supported by the runtime, for compat with newer versions. It still matches old Node.js on everything with what old Node.js works.

@ljharb
Copy link
Member

ljharb commented Dec 2, 2024

ah ok cool. then we just need an easy way to feature-detect whether update takes a typed array, for the tests :-)

@ChALkeR ChALkeR force-pushed the ChALkeR-patch-1 branch 5 times, most recently from c0f425f to 5c0a9d9 Compare June 29, 2025 14:41
@ljharb ljharb force-pushed the ChALkeR-patch-1 branch from 33db1ce to f2a258e Compare July 1, 2025 05:55
@ljharb ljharb merged commit f2a258e into browserify:master Jul 1, 2025
376 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