diff options
| author | Fuwn <[email protected]> | 2024-08-24 03:05:43 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-08-24 03:05:43 -0700 |
| commit | c654c46477602b162b931689902ecd09f574fbb1 (patch) | |
| tree | 8a8c2db5314f52a344c3dff96dc5145e897f697d /src/lib/Utility/fingerprint.ts | |
| parent | refactor(Data): rename database references (diff) | |
| download | due.moe-c654c46477602b162b931689902ecd09f574fbb1.tar.xz due.moe-c654c46477602b162b931689902ecd09f574fbb1.zip | |
feat(notifications): fingerprint for multiple grants
Diffstat (limited to 'src/lib/Utility/fingerprint.ts')
| -rw-r--r-- | src/lib/Utility/fingerprint.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/Utility/fingerprint.ts b/src/lib/Utility/fingerprint.ts new file mode 100644 index 00000000..d526d332 --- /dev/null +++ b/src/lib/Utility/fingerprint.ts @@ -0,0 +1,14 @@ +export const getFingerprint = () => + btoa( + `${(() => { + const gl = new OffscreenCanvas(0, 0).getContext('webgl'); + + if (!gl) return 'none'; + + const debugInfo = gl.getExtension('WEBGL_debug_renderer_info'); + + return debugInfo ? gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL) : 'unknown'; + })()}-${ + navigator === null || navigator === void 0 ? void 0 : navigator.hardwareConcurrency + }-${new Date().getTimezoneOffset()}` + ); |