Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 | 12x 12x | import {toBase64} from '@jsonjoy.com/base64/lib/toBase64';
export const toDataUri = (buf: Uint8Array, params?: Record<string, string | number>): string => {
let uri = 'data:application/octet-stream;base64';
for (const key in params) uri += `;${key}=${params[key]}`;
return uri + ',' + toBase64(buf);
};
|