source: node_modules/sha.js/README.md

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 1.7 KB
RevLine 
[d24f17c]1# sha.js
2[![NPM Package](https://img.shields.io/npm/v/sha.js.svg?style=flat-square)](https://www.npmjs.org/package/sha.js)
3[![Build Status](https://img.shields.io/travis/crypto-browserify/sha.js.svg?branch=master&style=flat-square)](https://travis-ci.org/crypto-browserify/sha.js)
4[![Dependency status](https://img.shields.io/david/crypto-browserify/sha.js.svg?style=flat-square)](https://david-dm.org/crypto-browserify/sha.js#info=dependencies)
5
6[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)
7
8Node style `SHA` on pure JavaScript.
9
10```js
11var shajs = require('sha.js')
12
13console.log(shajs('sha256').update('42').digest('hex'))
14// => 73475cb40a568e8da8a045ced110137e159f890ac4da883b6b17dc651b3a8049
15console.log(new shajs.sha256().update('42').digest('hex'))
16// => 73475cb40a568e8da8a045ced110137e159f890ac4da883b6b17dc651b3a8049
17
18var sha256stream = shajs('sha256')
19sha256stream.end('42')
20console.log(sha256stream.read().toString('hex'))
21// => 73475cb40a568e8da8a045ced110137e159f890ac4da883b6b17dc651b3a8049
22```
23
24## supported hashes
25`sha.js` currently implements:
26
27 - SHA (SHA-0) -- **legacy, do not use in new systems**
28 - SHA-1 -- **legacy, do not use in new systems**
29 - SHA-224
30 - SHA-256
31 - SHA-384
32 - SHA-512
33
34
35## Not an actual stream
36Note, this doesn't actually implement a stream, but wrapping this in a stream is trivial.
37It 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).
38
39
40## Acknowledgements
41This work is derived from Paul Johnston's [A JavaScript implementation of the Secure Hash Algorithm](http://pajhome.org.uk/crypt/md5/sha1.html).
42
43
44## LICENSE [MIT](LICENSE)
Note: See TracBrowser for help on using the repository browser.