(str)
| 607 | // Using this function instead of 'btoa' directly. |
| 608 | // https://developer.mozilla.org/en-US/docs/Glossary/Base64#the_unicode_problem |
| 609 | export function stringToBase64(str) { |
| 610 | return btoa( |
| 611 | Array.from( |
| 612 | new TextEncoder().encode(str), |
| 613 | (byte) => String.fromCodePoint(byte), |
| 614 | ).join('') |
| 615 | ); |
| 616 | } |
| 617 | |
| 618 | /************************************ |
| 619 | * |