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