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

hash update fail #9364

Closed
makc opened this issue Oct 30, 2016 · 1 comment
Closed

hash update fail #9364

makc opened this issue Oct 30, 2016 · 1 comment

Comments

@makc
Copy link

makc commented Oct 30, 2016

node v5.11 on mac:

$ node
> var sha256 = require('crypto').createHash('sha256');
undefined
> sha256.update('1')
Hash { _handle: {}, _options: undefined }
> sha256.digest('hex')
'6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b'
> sha256.update('2')
TypeError: HashUpdate fail
    at TypeError (native)
    at Hash.update (crypto.js:70:16)
    at repl:1:8
    at REPLServer.defaultEval (repl.js:270:27)
    at bound (domain.js:287:14)
    at REPLServer.runBound [as eval] (domain.js:300:12)
    at REPLServer.<anonymous> (repl.js:439:10)
    at emitOne (events.js:95:20)
    at REPLServer.emit (events.js:182:7)
    at REPLServer.Interface._onLine (readline.js:211:10)
> 

the docs say, "This can be called many times with new data as it is streamed", apparently not?

@makc
Copy link
Author

makc commented Oct 30, 2016

the docs also say, "The Hash object can not be used again after hash.digest() method has been called. Multiple calls will cause an error to be thrown" 💩

@makc makc closed this as completed Oct 30, 2016
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

1 participant