From 058c8d79b240d0d2466098c9e2a5039a0ed04c5f Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Sat, 25 Jul 2026 00:15:25 -0700 Subject: [PATCH] Brief random bytes instead of weird UUID manipulation. --- index.html | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 4f307c7..2973394 100644 --- a/index.html +++ b/index.html @@ -42,12 +42,9 @@ SPDX-License-Identifier: GPL-3.0-or-later return gl?.drawingBufferHeight < gl?.drawingBufferWidth ? gl?.drawingBufferHeight : gl?.drawingBufferWidth })(new OffscreenCanvas(0, 0)) - function random(size = 64) { - let hex = '' - while (hex.length < size) { - hex += crypto.randomUUID().replace(/-.*-/g, '') - } - return hex.slice(0, size) + function random (length = 32) { + const bytes = crypto.getRandomValues(new Uint8Array(length)) + return [...bytes].map(b => b.toString(16).padStart(2, '0')).join('') } function average(times, type, effort) { -- 2.52.0