fix: missing brace in users.js, ws double-increment, b64url stack overflow, docs storage

This commit is contained in:
2026-07-28 13:17:12 +00:00
parent ca27ea5522
commit f77473c13c
5 changed files with 16 additions and 6 deletions
+5 -1
View File
@@ -166,7 +166,11 @@ function b64urlToArrayBuffer(b64url) {
*/
function arrayBufferToB64url(buffer) {
const bytes = new Uint8Array(buffer);
const bin = String.fromCharCode.apply(null, Array.from(bytes));
const chunks = [];
for (let i = 0; i < bytes.length; i += 0x8000) {
chunks.push(String.fromCharCode.apply(null, bytes.slice(i, i + 0x8000)));
}
const bin = chunks.join('');
return btoa(bin)
.replace(/\+/g, '-')
.replace(/\//g, '_')