diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-12-10 21:51:33 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-12-10 21:51:33 +0100 |
commit | 0469abd4a9c9270a1fdc962969e36e63699af8b4 (patch) | |
tree | f9864d4a4148621378958794cbbfdc2393733283 /node_modules/sha.js/README.md | |
parent | 6947e79bbc258f7bc96af424ddb71a511f0c15a3 (diff) |
upgrade dependencies
Diffstat (limited to 'node_modules/sha.js/README.md')
-rw-r--r-- | node_modules/sha.js/README.md | 62 |
1 files changed, 26 insertions, 36 deletions
diff --git a/node_modules/sha.js/README.md b/node_modules/sha.js/README.md index fbce2319b..1cc3db558 100644 --- a/node_modules/sha.js/README.md +++ b/node_modules/sha.js/README.md @@ -1,54 +1,44 @@ # sha.js +[](https://www.npmjs.org/package/sha.js) +[](https://travis-ci.org/crypto-browserify/sha.js) +[](https://david-dm.org/crypto-browserify/sha.js#info=dependencies) -Streamable SHA hashes in pure javascript. +[](https://github.com/feross/standard) -[](http://travis-ci.org/crypto-browserify/sha.js) -[](https://www.npmjs.org/package/sha.js) +Node style `SHA` on pure JavaScript. +```js +var shajs = require('sha.js') -## Example - -``` js -var createHash = require('sha.js') - -var sha256 = createHash('sha256') -var sha512 = createHash('sha512') - -var h = sha256.update('abc', 'utf8').digest('hex') -console.log(h) //ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad - -//LEGACY, do not use in new systems: -var sha0 = createHash('sha') -var sha1 = createHash('sha1') - +console.log(shajs('sha256').update('42').digest('hex')) +// => 73475cb40a568e8da8a045ced110137e159f890ac4da883b6b17dc651b3a8049 +console.log(new shajs.sha256().update('42').digest('hex')) +// => 73475cb40a568e8da8a045ced110137e159f890ac4da883b6b17dc651b3a8049 +var sha256stream = shajs('sha256') +sha256stream.end('42') +console.log(sha256stream.read().toString('hex')) +// => 73475cb40a568e8da8a045ced110137e159f890ac4da883b6b17dc651b3a8049 ``` ## supported hashes +`sha.js` currently implements: -sha.js currently implements: + - SHA (SHA-0) -- **legacy, do not use in new systems** + - SHA-1 -- **legacy, do not use in new systems** + - SHA-224 + - SHA-256 + - SHA-384 + - SHA-512 -* sha256 -* sha512 -* sha1 (legacy, no not use in new systems) -* sha (legacy, no not use in new systems) - -## Note - +## Not an actual stream Note, this doesn't actually implement a stream, but wrapping this in a stream is trivial. -but is does update incrementally, so you can hash things larger than ram, and also, since it reuses -the typedarrays, it uses a constant amount of memory (except when using base64 or utf8 encoding, -see code comments) +It does update incrementally, so you can hash things larger than RAM, as it uses a constant amount of memory (except when using base64 or utf8 encoding, see code comments). ## Acknowledgements +This work is derived from Paul Johnston's [A JavaScript implementation of the Secure Hash Algorithm](http://pajhome.org.uk/crypt/md5/sha1.html). -This work is derived from Paul Johnston's ["A JavaScript implementation of the Secure Hash Algorithm"] -(http://pajhome.org.uk/crypt/md5/sha1.html) - - - -## License -MIT +## LICENSE [MIT](LICENSE) |