UNPKG

530 BJavaScriptView Raw
1var siphash = require('siphash24')
2
3if (new Uint16Array([1])[0] !== 1) throw new Error('Big endian architecture is not supported.')
4
5exports.crypto_shorthash_PRIMITIVE = 'siphash24'
6exports.crypto_shorthash_BYTES = siphash.BYTES
7exports.crypto_shorthash_KEYBYTES = siphash.KEYBYTES
8exports.crypto_shorthash_WASM_SUPPORTED = siphash.WASM_SUPPORTED
9exports.crypto_shorthash_WASM_LOADED = siphash.WASM_LOADED
10exports.crypto_shorthash = shorthash
11
12function shorthash (out, data, key, noAssert) {
13 siphash(data, key, out, noAssert)
14}