diff options
| author | MHSanaei <ho3ein.sanaei@gmail.com> | 2026-04-27 02:23:38 +0300 |
|---|---|---|
| committer | MHSanaei <ho3ein.sanaei@gmail.com> | 2026-04-27 02:28:06 +0300 |
| commit | 9791b05a4efd2e22621927b9e80d288386e510df (patch) | |
| tree | 1d9051f35c96795a2d7a41c32d619a8a33e21f7e /web/assets/js/util | |
| parent | 0aca2d3b3d7e54f0408670db5f7075eaee190066 (diff) | |
kcp: noise, header-custom, sudoku
Diffstat (limited to 'web/assets/js/util')
| -rw-r--r-- | web/assets/js/util/index.js | 6 |
1 files changed, 6 insertions, 0 deletions
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); |
