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