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

Types in documentation don't match actual types #33

Closed
r-arias opened this issue Jun 13, 2014 · 1 comment
Closed

Types in documentation don't match actual types #33

r-arias opened this issue Jun 13, 2014 · 1 comment

Comments

@r-arias
Copy link

r-arias commented Jun 13, 2014

Hello,
it seems to me, that some of the (not all) functions do not actually return Uint8Arrays but Buffers, resulting in checks like nacl.random_bytes(16) instanceof Uint8Array failing (nacl.crypto_hash(nacl.random_bytes(16)) instanceof Uint8Array passes fine).
There are some parts of my application, where I rely on the objects actually being of type Uint8Array. It would be nice, if the documentation would more clearly reflect, where Uint8Array is to be expected, and where Buffers are.

Thanks in advance!
r

@tonyg
Copy link
Owner

tonyg commented Nov 19, 2018

Since the switch to libsodium, random_bytes should produce Uint8Array all the time. Sorry this was a problem for you.

@tonyg tonyg closed this as completed Nov 19, 2018
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