15 lines
530 B
JavaScript
15 lines
530 B
JavaScript
var siphash = require('siphash24')
|
|
|
|
if (new Uint16Array([1])[0] !== 1) throw new Error('Big endian architecture is not supported.')
|
|
|
|
exports.crypto_shorthash_PRIMITIVE = 'siphash24'
|
|
exports.crypto_shorthash_BYTES = siphash.BYTES
|
|
exports.crypto_shorthash_KEYBYTES = siphash.KEYBYTES
|
|
exports.crypto_shorthash_WASM_SUPPORTED = siphash.WASM_SUPPORTED
|
|
exports.crypto_shorthash_WASM_LOADED = siphash.WASM_LOADED
|
|
exports.crypto_shorthash = shorthash
|
|
|
|
function shorthash (out, data, key, noAssert) {
|
|
siphash(data, key, out, noAssert)
|
|
}
|