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

Specify key type (avoid browser Buffer/ArrayBuffer gotcha) #189

Merged
merged 1 commit into from Jan 22, 2019

Conversation

Projects
None yet
3 participants
@aral
Copy link
Contributor

aral commented Jan 17, 2019

hypercore constructor accepts Node.js Buffer instances, not ArrayBuffer instances. This is a gotcha when using hypercore in the browser. This change explicitly documents this behaviour.

Specify key type (avoid browser Buffer/ArrayBuffer gotcha)
hypercore constructor accepts Node.js Buffer instances, not ArrayBuffer instances. This is a gotcha when using hypercore in the browser. This change explicitly documents this behaviour.
@martinheidegger

This comment has been minimized.

Copy link
Contributor

martinheidegger commented Jan 17, 2019

I find that note very helpful. hypercore uses internally buffer-from to convert a string-input into a buffer key. Should be helpful in the browser as well.

@mafintosh

This comment has been minimized.

Copy link
Owner

mafintosh commented Jan 22, 2019

Would be cool to support uint8arrays plus arraybuffers as well in the future (shouldn't be too hard) 👍

@mafintosh mafintosh merged commit bedcfa2 into mafintosh:master Jan 22, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment