1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 02:39:46 +02:00
Oinktube/node_modules/@videojs/vhs-utils/es/decode-b64-to-uint8-array.js
Daniel d4d042e041 Moving to node_modules folder to make easier to upgrade
trying to move from Bootstrap 3 to Bootstrap 5
2021-10-26 14:52:45 -03:00

16 lines
No EOL
420 B
JavaScript

import window from 'global/window';
var atob = function atob(s) {
return window.atob ? window.atob(s) : Buffer.from(s, 'base64').toString('binary');
};
export default function decodeB64ToUint8Array(b64Text) {
var decodedString = atob(b64Text);
var array = new Uint8Array(decodedString.length);
for (var i = 0; i < decodedString.length; i++) {
array[i] = decodedString.charCodeAt(i);
}
return array;
}