get-browser-fingerprint 3.2.2 → 3.2.3
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/package.json +2 -2
- package/src/index.d.ts +14 -0
- package/src/index.js +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "get-browser-fingerprint",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.3",
|
|
4
4
|
"author": "Damiano Barbati <damiano.barbati@gmail.com> (https://github.com/damianobarbati)",
|
|
5
5
|
"repository": "https://github.com/damianobarbati/get-browser-fingerprint",
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"README.md",
|
|
11
11
|
"package.json",
|
|
12
12
|
"src/index.js",
|
|
13
|
-
"src/index.d.
|
|
13
|
+
"src/index.d.ts"
|
|
14
14
|
],
|
|
15
15
|
"types": "./src/index.d.ts",
|
|
16
16
|
"scripts": {
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface FingerprintOptions {
|
|
2
|
+
hardwareOnly?: boolean;
|
|
3
|
+
enableWebgl?: boolean;
|
|
4
|
+
enableScreen?: boolean;
|
|
5
|
+
debug?: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export default function getBrowserFingerprint(options?: FingerprintOptions): number;
|
|
9
|
+
|
|
10
|
+
declare global {
|
|
11
|
+
interface Window {
|
|
12
|
+
getBrowserFingerprint: typeof getBrowserFingerprint;
|
|
13
|
+
}
|
|
14
|
+
}
|
package/src/index.js
CHANGED
|
@@ -59,7 +59,7 @@ const getBrowserFingerprint = ({ hardwareOnly = false, enableWebgl = false, enab
|
|
|
59
59
|
return result;
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
const getCanvasID = (debug) => {
|
|
63
63
|
try {
|
|
64
64
|
const canvas = document.createElement("canvas");
|
|
65
65
|
const ctx = canvas.getContext("2d");
|
|
@@ -88,7 +88,7 @@ export const getCanvasID = (debug) => {
|
|
|
88
88
|
}
|
|
89
89
|
};
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
const getWebglID = (debug) => {
|
|
92
92
|
try {
|
|
93
93
|
const canvas = document.createElement("canvas");
|
|
94
94
|
const ctx = canvas.getContext("webgl");
|
|
@@ -148,7 +148,7 @@ export const getWebglID = (debug) => {
|
|
|
148
148
|
}
|
|
149
149
|
};
|
|
150
150
|
|
|
151
|
-
|
|
151
|
+
const getWebglInfo = () => {
|
|
152
152
|
try {
|
|
153
153
|
const ctx = document.createElement("canvas").getContext("webgl");
|
|
154
154
|
|
|
@@ -165,7 +165,7 @@ export const getWebglInfo = () => {
|
|
|
165
165
|
}
|
|
166
166
|
};
|
|
167
167
|
|
|
168
|
-
|
|
168
|
+
const murmurhash3_32_gc = (key) => {
|
|
169
169
|
const remainder = key.length & 3; // key.length % 4
|
|
170
170
|
const bytes = key.length - remainder;
|
|
171
171
|
const c1 = 0xcc9e2d51;
|