basic encrypt

This commit is contained in:
fyears
2021-10-27 00:33:35 +08:00
parent b450fa5c44
commit 58cd51d776
3 changed files with 101 additions and 0 deletions
+9
View File
@@ -49,3 +49,12 @@ export const mkdirpInVault = async (thePath: string, vault: Vault) => {
export const bufferToArrayBuffer = (b: Buffer) => {
return b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength);
};
/**
* Simple func.
* @param b
* @returns
*/
export const arrayBufferToBuffer = (b: ArrayBuffer) => {
return Buffer.from(b);
};