mirror of
https://github.com/Av0idD4rk/packmate.git
synced 2026-10-25 02:09:24 +00:00
Безопасное преобразование b64 в юникод
This commit is contained in:
parent
36fdb69be1
commit
fb3637a8b2
@ -47,9 +47,16 @@
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
atou(b64) {
|
atou(b64) {
|
||||||
return decodeURIComponent(escape(atob(b64)));
|
const text = atob(b64);
|
||||||
},
|
const length = text.length;
|
||||||
|
const bytes = new Uint8Array(length);
|
||||||
|
for (let i = 0; i < length; i++) {
|
||||||
|
bytes[i] = text.charCodeAt(i);
|
||||||
|
}
|
||||||
|
const decoder = new TextDecoder();
|
||||||
|
return decoder.decode(bytes);
|
||||||
|
},
|
||||||
printPacketFlags(packet) {
|
printPacketFlags(packet) {
|
||||||
let flags = [];
|
let flags = [];
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user