-
Notifications
You must be signed in to change notification settings - Fork 23
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
Accept Uint8Array
in place of Buffer
#12
Comments
Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
Finally, remember to use https://discuss.ipfs.io if you just need general support. |
While I'm inclined to remove dependency on More pragmatic approach would be to just expect |
Is the assumption here that protons/src/compile/encodings.js Lines 30 to 43 in 3b5276f
Without necessarily understanding all the details here, it appears to me that supporting strings here is a bad idea. Because detecting This probably out of scope for this issue, but thought I'd still post it here. |
With this change all the `Buffer` inputs were replaced by `Uint8Array` which is backwards compatible since `Buffer` is a subclass. This does make an assumption that "bytes" encoder used to take `Buffer|string` here: https://github.com/ipfs/protons/blob/3b5276f052f2e17c2d806d27cd9a88e156588977/src/compile/encodings.js#L30-L43 Fixes #12
Changes to
dag-pb
attempted to add support forUint8Array
s in place of nodeBuffer
to better support case where data is passed across web workers. @achingbrain had a thought that it might be better yet to add support forUint8Array
s at this layer instead.Opening issue to track / discuss this here.
The text was updated successfully, but these errors were encountered: