Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'web/assets/js/util/index.js')
-rw-r--r--web/assets/js/util/index.js6
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);