aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Utility/fingerprint.ts
blob: 2c7211b4b0b91d43c3946ad4a026bf23429a16ec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
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()}`
  );