Tracking de l'application VApp (IHM du jeu)
This commit is contained in:
13
VApp/node_modules/@videojs/vhs-utils/src/decode-b64-to-uint8-array.js
generated
vendored
Normal file
13
VApp/node_modules/@videojs/vhs-utils/src/decode-b64-to-uint8-array.js
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
import window from 'global/window';
|
||||
|
||||
const atob = (s) => window.atob ? window.atob(s) : Buffer.from(s, 'base64').toString('binary');
|
||||
|
||||
export default function decodeB64ToUint8Array(b64Text) {
|
||||
const decodedString = atob(b64Text);
|
||||
const array = new Uint8Array(decodedString.length);
|
||||
|
||||
for (let i = 0; i < decodedString.length; i++) {
|
||||
array[i] = decodedString.charCodeAt(i);
|
||||
}
|
||||
return array;
|
||||
}
|
Reference in New Issue
Block a user