https://github.com/make-github-pseudonymous-again/js-hash
:hocho: Hashing algorithms for JavaScript
https://github.com/make-github-pseudonymous-again/js-hash
hash hashing md5 sha1 sha2 sha224 sha256 sha384 sha512 string string-hashing
Last synced: 7 months ago
JSON representation
:hocho: Hashing algorithms for JavaScript
- Host: GitHub
- URL: https://github.com/make-github-pseudonymous-again/js-hash
- Owner: make-github-pseudonymous-again
- License: agpl-3.0
- Created: 2014-10-02T20:48:55.000Z (about 11 years ago)
- Default Branch: main
- Last Pushed: 2022-10-19T12:14:59.000Z (almost 3 years ago)
- Last Synced: 2024-04-14T01:18:19.088Z (over 1 year ago)
- Topics: hash, hashing, md5, sha1, sha2, sha224, sha256, sha384, sha512, string, string-hashing
- Homepage:
- Size: 1.54 MB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
:hocho:
`js-hash`
==
![]()
© xkcd.comHashing algorithms for JavaScript.
```js
import {alloc} from '@array-like/alloc';
import * as ascii from '@codec-bytes/ascii';
import * as base16 from '@codec-bytes/base16';
import {sha512} from '@string-hashing/sha2';
const string = 'The quick brown fox jumps over the lazy dog';
const bytes = ascii.encode(string);
const digest = sha512(bytes, bytes.length * 8, alloc(64));
digest; // [0x07, 0xe5, 0x47, 0xd9, 0x58, 0x6f, 0x6a, 0x73, 0xf7, 0x3f, ...]
base16.decode(digest); // '07E547D9586F6A73F73FBAC0435ED76951218FB7D0C8D788A309D785436B...'
```## :deciduous_tree: Hierarchy
### :oden: String hashing
- [`@string-hashing/sha2`](https://github.com/string-hashing/sha2)
- [`@string-hashing/sha1`](https://github.com/string-hashing/sha1)
- [`@string-hashing/md5`](https://github.com/string-hashing/md5)