这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@RainaBatwing
Copy link

Seems like a useful utility, so lets make it public? #60

dchest added a commit that referenced this pull request Dec 21, 2014
While JavaScript doesn't guarantee that the memory will actually be
cleaned when we zero-out arrays, we zero them anyway and hope that the
current implementations of JS VMs will do what we ask, as we have no
choice.

Thanks to @RainaBatwing for idea.
Closes #62, updates #60.
@dchest
Copy link
Owner

dchest commented Dec 21, 2014

Thanks for PR and sorry for the late reply. After thinking it through I decided that it's best we don't expose this in nacl.util, as I think I'll deprecate nacl.util in the future, and perhaps put it into a separate package (it's crazy when every crypto library have their own string conversion functions) to encourage people to use other "proper" libraries.

I also simplified the function to make it accept just one argument and not use Buffer's fill (for now) to keep the spirit of TweetNaCl of short and auditable code. Here's the PR: #63, what do you think about it?

@RainaBatwing
Copy link
Author

Maybe consider using fill in nacl-fast, because performance is a goal?

@dchest
Copy link
Owner

dchest commented Dec 22, 2014

@RainaBatwing agreed, we can use fill in the future, but now I think PRNG performance won't suffer much, as we get short arrays from it.

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