@voiceflow/common 7.14.0 → 7.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/common/crypto/murmurhash.d.ts +4 -0
- package/build/common/crypto/murmurhash.js +16 -0
- package/build/common/crypto/murmurhash.js.map +1 -0
- package/build/esm/crypto/murmurhash.d.ts +4 -0
- package/build/esm/crypto/murmurhash.js +12 -0
- package/build/esm/crypto/murmurhash.js.map +1 -0
- package/package.json +3 -2
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MurmurHash = void 0;
|
|
4
|
+
const murmurhash_wasm_1 = require("murmurhash-wasm");
|
|
5
|
+
const hex2abc_1 = require("./hex2abc");
|
|
6
|
+
class MurmurHash {
|
|
7
|
+
static hash(key, seed) {
|
|
8
|
+
const hash = murmurhash_wasm_1.MurmurHash3.hash32(key, seed);
|
|
9
|
+
const value = hash.readUInt32BE();
|
|
10
|
+
const hex = value.toString(16);
|
|
11
|
+
return hex2abc_1.hex2abc(hex);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.MurmurHash = MurmurHash;
|
|
15
|
+
exports.default = MurmurHash;
|
|
16
|
+
//# sourceMappingURL=murmurhash.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"murmurhash.js","sourceRoot":"","sources":["../../../src/crypto/murmurhash.ts"],"names":[],"mappings":";;;AAAA,qDAA8C;AAE9C,uCAA2C;AAE3C,MAAa,UAAU;IACd,MAAM,CAAC,IAAI,CAAC,GAAW,EAAE,IAAY;QAC1C,MAAM,IAAI,GAAG,6BAAW,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAC3C,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QAClC,MAAM,GAAG,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAE/B,OAAO,iBAAO,CAAC,GAAG,CAAC,CAAC;IACtB,CAAC;CACF;AARD,gCAQC;AAED,kBAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MurmurHash3 } from 'murmurhash-wasm';
|
|
2
|
+
import { hex2abc } from "./hex2abc";
|
|
3
|
+
export class MurmurHash {
|
|
4
|
+
static hash(key, seed) {
|
|
5
|
+
const hash = MurmurHash3.hash32(key, seed);
|
|
6
|
+
const value = hash.readUInt32BE();
|
|
7
|
+
const hex = value.toString(16);
|
|
8
|
+
return hex2abc(hex);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export default MurmurHash;
|
|
12
|
+
//# sourceMappingURL=murmurhash.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"murmurhash.js","sourceRoot":"","sources":["../../../src/crypto/murmurhash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,kBAAyB;AAE3C,MAAM,OAAO,UAAU;IACd,MAAM,CAAC,IAAI,CAAC,GAAW,EAAE,IAAY;QAC1C,MAAM,IAAI,GAAG,WAAW,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAC3C,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QAClC,MAAM,GAAG,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAE/B,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC;IACtB,CAAC;CACF;AAED,eAAe,UAAU,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voiceflow/common",
|
|
3
3
|
"description": "Junk drawer of utility functions",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.15.0",
|
|
5
5
|
"author": "Voiceflow",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/voiceflow/libs/issues"
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"cuid": "^2.1.8",
|
|
14
14
|
"dayjs": "^1.10.7",
|
|
15
15
|
"lodash": "^4.17.21",
|
|
16
|
+
"murmurhash-wasm": "^1.2.2",
|
|
16
17
|
"number-to-words": "^1.2.4",
|
|
17
18
|
"typescript-fsa": "3.0.0"
|
|
18
19
|
},
|
|
@@ -72,5 +73,5 @@
|
|
|
72
73
|
"test:single": "NODE_ENV=test ts-mocha --paths --config config/tests/mocharc.yml",
|
|
73
74
|
"test:unit": "NODE_ENV=test nyc --report-dir=nyc_coverage_unit ts-mocha --paths --config config/tests/mocharc.yml 'tests/**/*.unit.ts'"
|
|
74
75
|
},
|
|
75
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "a6e4cb2fb4d1144bfae03d7ad42b3cce37cff28a"
|
|
76
77
|
}
|