forked from LaconicNetwork/icns-frontend
Use Buffer
package instead of Buffer on nodejs
This commit is contained in:
parent
b47c09fb6f
commit
1ea85324aa
@ -1,5 +1,7 @@
|
|||||||
export function base64URLEncode(str: Buffer) {
|
import { Buffer } from "buffer/";
|
||||||
return str
|
|
||||||
|
export function base64URLEncode(str: Uint8Array) {
|
||||||
|
return Buffer.from(str)
|
||||||
.toString("base64")
|
.toString("base64")
|
||||||
.replace(/\+/g, "-")
|
.replace(/\+/g, "-")
|
||||||
.replace(/\//g, "_")
|
.replace(/\//g, "_")
|
||||||
|
Loading…
Reference in New Issue
Block a user