(str: string)
| 17 | } |
| 18 | |
| 19 | const stringToArrayBuffer = (str: string): ArrayBuffer => { |
| 20 | const buffer = new ArrayBuffer(str.length) |
| 21 | const view = new Uint8Array(buffer) |
| 22 | for (let i = 0; i < str.length; i++) { |
| 23 | view[i] = str.charCodeAt(i) & 0xff |
| 24 | } |
| 25 | return buffer |
| 26 | } |
| 27 | |
| 28 | export const createBlobUrl = (data: string, fileType: string): string => { |
| 29 | // Create a Blob URL from the given data and file type. |