yes encryption!

This commit is contained in:
fyears
2021-11-02 02:39:24 +08:00
parent 010561596e
commit a9d80bef8f
3 changed files with 79 additions and 48 deletions
+8
View File
@@ -58,3 +58,11 @@ export const bufferToArrayBuffer = (b: Buffer) => {
export const arrayBufferToBuffer = (b: ArrayBuffer) => {
return Buffer.from(b);
};
export const arrayBufferToBase64 = (b: ArrayBuffer) => {
return arrayBufferToBuffer(b).toString("base64");
};
export const base64ToArrayBuffer = (b64text: string) => {
return bufferToArrayBuffer(Buffer.from(b64text, "base64"));
};