cosmos-explorer/src/Utils/Base64Utils.ts
Laurent Nguyen 90c1439d34
Update prettier to latest. Remove tslint (#1641)
* Rev up prettier

* Reformat

* Remove deprecated tslint

* Remove call to tslint and update package-lock.json
2023-10-03 17:13:24 +02:00

8 lines
215 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));
}),
);
};