aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Utility/fingerprint.ts
blob: d526d3323c72e819e9cbc5510de4139ff342707f (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()}`
	);