@string-hashing/sha1

0.0.1 • Public • Published

@string-hashing/sha1

SHA1 bytestring hashing for JavaScript. See docs.

import {alloc} from '@array-like/alloc';
import * as ascii from '@codec-bytes/ascii';
import * as base16 from '@codec-bytes/base16';
import {sha1} from '@string-hashing/sha1';
const string = 'The quick brown fox jumps over the lazy dog';
const bytes = ascii.encode(string);
const digest = sha1(bytes, bytes.length * 8, alloc(20));
digest; // [0x2f, 0xd4, 0xe1, 0xc6, 0x7a, 0x2d, 0x28, 0xfc, 0xed, 0x84, ...]
base16.decode(digest); // '2FD4E1C67A2D28FCED849EE1BB76E7391B93EB12'

License Version Tests Dependencies GitHub issues Downloads

Code issues Code maintainability Code coverage (cov) Code technical debt Documentation Package size

Package Sidebar

Install

npm i @string-hashing/sha1

Weekly Downloads

4

Version

0.0.1

License

AGPL-3.0

Unpacked Size

503 kB

Total Files

14

Last publish

Collaborators

  • raskat