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

support multi-byte wide typed arrays #78

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ChALkeR
Copy link

@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
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 :-)

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