UNPKG

simple-js-sha2-224

Version:

how to import: ``` const sha2_224 = require('simple-js-sha2-224') ``` hashing: ``` sha2_224('hello') // ea09ae9cc6768c50fcee903ed054556e5bfc8347907f12598aa24193 ``` performance: 77.8 kh/s ~ (Core I7-7920HQ single thread)

14 lines (12 loc) 520 B
const tests = { 'The quick brown fox jumps over the lazy dog': '730e109bd7a8a32b1cb9d9a09aa2325d2430587ddbc0c38bad911525', 'The quick brown fox jumps over the lazy dog.': '619cba8e8e05826e9b8c519c0a5c68f4fb653e8a3d8aa04bb2c8cd4c', } const sha2_224 = require('../src/main.js') for (const input of Object.keys(tests)) { const output = tests[input] if (sha2_224(input) !== tests[input]) { throw `input failed ${input} ${sha2_224(input)} should be ${output}` } } console.log('✅ tests passed')