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

Deprecated #8

Open
narayananramu opened this issue Apr 12, 2017 · 5 comments
Open

Deprecated #8

narayananramu opened this issue Apr 12, 2017 · 5 comments

Comments

@narayananramu
Copy link

Hi

I am interested to carry this project further. I having using the module for more than a year now, I don't find a easy alternative for this library.

@jprichardson
Copy link
Member

Hi @narayananramu why not use either Node.js crypto or https://www.npmjs.com/package/create-hash?

@narayananramu
Copy link
Author

@jprichardson because

sha256('sss')

is easier than

hash.update('synchronous write'); hash.digest();

@fanatid
Copy link
Member

fanatid commented Apr 15, 2017

update is chainable method
createHash('sha256').update(Buffer).digest() is valid code

@narayananramu
Copy link
Author

narayananramu commented Apr 15, 2017

@fanatid also

sha256.x2('string');

is easier than

createHash('sha256').update(createHash('sha256').update('string').digest()).digest()

@hijarian
Copy link

just write a one-line wrapper in your own code and call it a day, even safer because it's your own layer of abstraction now:

const hash = (payload: string): string => createHash('sha256').update(createHash('sha256').update('string').digest()).digest();

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

4 participants