From 9791b05a4efd2e22621927b9e80d288386e510df Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Mon, 27 Apr 2026 01:23:38 +0200 Subject: kcp: noise, header-custom, sudoku --- web/assets/js/util/index.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'web/assets/js/util') diff --git a/web/assets/js/util/index.js b/web/assets/js/util/index.js index cc7b9287..1f481c85 100644 --- a/web/assets/js/util/index.js +++ b/web/assets/js/util/index.js @@ -152,6 +152,12 @@ class RandomUtil { return Base64.alternativeEncode(String.fromCharCode(...array)); } + static randomBase64(length = 16) { + const array = new Uint8Array(length); + window.crypto.getRandomValues(array); + return Base64.alternativeEncode(String.fromCharCode(...array)); + } + static randomBase32String(length = 16) { const array = new Uint8Array(length); -- cgit v1.2.3