mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2024-12-04 19:37:07 +00:00
8 lines
221 B
TypeScript
8 lines
221 B
TypeScript
|
export const utf8ToB64 = (utf8Str: string): string => {
|
||
|
return btoa(
|
||
|
encodeURIComponent(utf8Str).replace(/%([0-9A-F]{2})/g, (_, args) => {
|
||
|
return String.fromCharCode(parseInt(args, 16));
|
||
|
})
|
||
|
);
|
||
|
};
|