sync-sha1
Synchronous sha1 in JavaScript
Shamelessly stolen from jbt/tiny-hashes and improved.
It is basically a synchronous sha1()
hash function for browsers, with no guaranties.
The improvement consists in the usage of the Uint32Array
instead of Array
internaly
and compatibility with Uint8Array
on input/output.
For Node.js you should use the crypto
module!
Usage
The Easy way
var sha1 = ; ; // "150f7d2a6e9f80f03c639b17878bce65b5a033a8"
The Tiny way
; // rollup.js ? const buffer = 'sync-sha1';const hash = ;hash; // "150f7d2a6e9f80f03c639b17878bce65b5a033a8"
The Native Browser way
; // rollup.js ? const hash = await ;hash; // "150f7d2a6e9f80f03c639b17878bce65b5a033a8"
Direct Browser include:
Use it at your own risk!