icns-frontend/utils/encoding.ts

8 lines
160 B
TypeScript
Raw Normal View History

2022-12-05 10:50:13 +00:00
export function base64URLEncode(str: Buffer) {
return str
.toString("base64")
.replace(/\+/g, "-")
.replace(/\//g, "_")
.replace(/=/g, "");
}