@string-hashing/md5
v0.0.1
Published
MD5 bytestring hashing for JavaScript
Downloads
4
Readme
:question: @string-hashing/md5
MD5 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 {md5} from '@string-hashing/md5';
const string = 'The quick brown fox jumps over the lazy dog';
const bytes = ascii.encode(string);
const digest = md5(bytes, bytes.length * 8, alloc(16));
digest; // [0x9e, 0x10, 0x7d, 0x9d, 0x37, 0x2b, 0xb6, 0x82, 0x6b, 0xd8, ...]
base16.decode(digest); // '9E107D9D372BB6826BD81D3542A419D6'