mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 16:26:43 +00:00
Remove unused b64ToBlob (#23763)
This commit is contained in:
parent
ebd1bdd686
commit
21c2351137
@ -1,20 +0,0 @@
|
|||||||
// https://stackoverflow.com/a/16245768
|
|
||||||
export const b64toBlob = (b64Data, contentType = "", sliceSize = 512) => {
|
|
||||||
const byteCharacters = atob(b64Data);
|
|
||||||
const byteArrays: Uint8Array[] = [];
|
|
||||||
|
|
||||||
for (let offset = 0; offset < byteCharacters.length; offset += sliceSize) {
|
|
||||||
const slice = byteCharacters.slice(offset, offset + sliceSize);
|
|
||||||
|
|
||||||
const byteNumbers = new Array(slice.length);
|
|
||||||
for (let i = 0; i < slice.length; i++) {
|
|
||||||
byteNumbers[i] = slice.charCodeAt(i);
|
|
||||||
}
|
|
||||||
|
|
||||||
const byteArray = new Uint8Array(byteNumbers);
|
|
||||||
|
|
||||||
byteArrays.push(byteArray);
|
|
||||||
}
|
|
||||||
|
|
||||||
return new Blob(byteArrays, { type: contentType });
|
|
||||||
};
|
|
Loading…
x
Reference in New Issue
Block a user