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

Uint8Array keys don't respect offsets from underlying ArrayBuffers #89

Closed
joeltg opened this issue Oct 25, 2023 · 3 comments
Closed

Uint8Array keys don't respect offsets from underlying ArrayBuffers #89

joeltg opened this issue Oct 25, 2023 · 3 comments

Comments

@joeltg
Copy link

joeltg commented Oct 25, 2023

In valueToKey, when you convert from Uint8Array or other data view (tested by ArrayBuffer.isView), the code currently returns new Uint8Array(input.buffer).buffer. This disregards the byteOffset and byteLength, which might only reference a slice of the underlying ArrayBuffer.

@dumbmatter
Copy link
Owner

Thanks you're right, does PR #90 look like a good fix?

@joeltg
Copy link
Author

joeltg commented Oct 25, 2023

Yeah that looks great!

@dumbmatter
Copy link
Owner

Fixed in v5.0.1

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

No branches or pull requests

2 participants