mirror of
https://github.com/sussy-code/providers.git
synced 2026-03-31 06:58:34 +00:00
remove Buffer
This commit is contained in:
parent
c44d13f0bd
commit
a208aef364
1 changed files with 3 additions and 4 deletions
|
|
@ -2,12 +2,11 @@ const DECRYPTION_KEY = '8z5Ag5wgagfsOuhz';
|
|||
|
||||
export const decodeBase64UrlSafe = (str: string) => {
|
||||
const standardizedInput = str.replace(/_/g, '/').replace(/-/g, '+');
|
||||
const decodedData = atob(standardizedInput);
|
||||
|
||||
const binaryData = Buffer.from(standardizedInput, 'base64').toString('binary');
|
||||
|
||||
const bytes = new Uint8Array(binaryData.length);
|
||||
const bytes = new Uint8Array(decodedData.length);
|
||||
for (let i = 0; i < bytes.length; i += 1) {
|
||||
bytes[i] = binaryData.charCodeAt(i);
|
||||
bytes[i] = decodedData.charCodeAt(i);
|
||||
}
|
||||
|
||||
return bytes;
|
||||
|
|
|
|||
Loading…
Reference in a new issue