@shapediver/viewer.shared.services 3.15.1 → 3.15.2

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.
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Creates a FNV-1a hash for a sampled Uint8Array.
3
+ *
4
+ * @param array
5
+ * @returns
6
+ */
7
+ export declare const hashForArraySampled: (array: Uint8Array) => string;
8
+ //# sourceMappingURL=hashCreator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hashCreator.d.ts","sourceRoot":"","sources":["../../src/utilities/hashCreator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,UAAW,UAAU,WAqBpD,CAAC"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hashForArraySampled = void 0;
4
+ /**
5
+ * Creates a FNV-1a hash for a sampled Uint8Array.
6
+ *
7
+ * @param array
8
+ * @returns
9
+ */
10
+ const hashForArraySampled = (array) => {
11
+ // Hash sample of bytes for speed, include length for uniqueness
12
+ let hash = 2166136261;
13
+ const len = array.length;
14
+ // Hash first 2KB
15
+ const sampleSize = Math.min(2048, len);
16
+ for (let i = 0; i < sampleSize; i++) {
17
+ hash ^= array[i];
18
+ hash = Math.imul(hash, 16777619);
19
+ }
20
+ // Hash last 2KB if array is large enough
21
+ if (len > sampleSize) {
22
+ for (let i = len - sampleSize; i < len; i++) {
23
+ hash ^= array[i];
24
+ hash = Math.imul(hash, 16777619);
25
+ }
26
+ }
27
+ return hash.toString(16);
28
+ };
29
+ exports.hashForArraySampled = hashForArraySampled;
30
+ //# sourceMappingURL=hashCreator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hashCreator.js","sourceRoot":"","sources":["../../src/utilities/hashCreator.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACI,MAAM,mBAAmB,GAAG,CAAC,KAAiB,EAAE,EAAE;IACxD,gEAAgE;IAChE,IAAI,IAAI,GAAG,UAAU,CAAC;IACtB,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC;IAEzB,iBAAiB;IACjB,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACvC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,EAAE,CAAC,EAAE,EAAE;QACpC,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;QACjB,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;KACjC;IAED,yCAAyC;IACzC,IAAI,GAAG,GAAG,UAAU,EAAE;QACrB,KAAK,IAAI,CAAC,GAAG,GAAG,GAAG,UAAU,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;YAC5C,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;YACjB,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;SACjC;KACD;IAED,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAC1B,CAAC,CAAC;AArBW,QAAA,mBAAmB,uBAqB9B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapediver/viewer.shared.services",
3
- "version": "3.15.1",
3
+ "version": "3.15.2",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "author": "Michael Oppitz <michael@shapediver.com>",
@@ -41,7 +41,7 @@
41
41
  "@ctrl/tinycolor": "^3.4.0",
42
42
  "@shapediver/sdk.geometry-api-sdk-v2": "2.10.0",
43
43
  "@shapediver/viewer.settings": "1.2.1",
44
- "@shapediver/viewer.shared.build-data": "3.15.1",
44
+ "@shapediver/viewer.shared.build-data": "3.15.2",
45
45
  "@types/ua-parser-js": "^0.7.36",
46
46
  "@types/uuid": "^9.0.0",
47
47
  "dompurify": "^3.2.6",
@@ -49,5 +49,5 @@
49
49
  "ua-parser-js": "^0.7.28",
50
50
  "uuid": "^9.0.0"
51
51
  },
52
- "gitHead": "db443683e526c699772febeb66889d6204e54b4c"
52
+ "gitHead": "b0fafd0073307a1fb4b8d5824f8554d733427131"
53
53
  }