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:
authorShishkevich D. <135337715+shishkevichd@users.noreply.github.com>2025-04-15 14:33:26 +0300
committerGitHub <noreply@github.com>2025-04-15 14:33:26 +0300
commit45c3d730d41eae59096ada87eb5767b04f76353d (patch)
treec99e5894018c62264ed091c627fafff338e1c040
parentaab01ff11a1b35b1e491c56c704826903b7797b1 (diff)
fix: Error when generating shadowsocks keys in Blake3_AES_256_GCM
-rw-r--r--web/assets/js/util/index.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/web/assets/js/util/index.js b/web/assets/js/util/index.js
index 1946eacf..a13006d4 100644
--- a/web/assets/js/util/index.js
+++ b/web/assets/js/util/index.js
@@ -140,8 +140,10 @@ class RandomUtil {
static randomShadowsocksPassword() {
const array = new Uint8Array(32);
+
window.crypto.getRandomValues(array);
- return Base64.encode(String.fromCharCode(...array));
+
+ return Base64.alternativeEncode(String.fromCharCode(...array));
}
}
@@ -528,6 +530,12 @@ class Base64 {
)
}
+ static alternativeEncode(content) {
+ return window.btoa(
+ content
+ )
+ }
+
static decode(content = "") {
return new TextDecoder()
.decode(
@@ -807,7 +815,7 @@ const MediaQueryMixin = {
}
class FileManager {
- static downloadTextFile(content, filename='file.txt', options = { type: "text/plain" }) {
+ static downloadTextFile(content, filename = 'file.txt', options = { type: "text/plain" }) {
let link = window.document.createElement('a');
link.download = filename;