init web crypto

This commit is contained in:
fyears
2021-11-04 10:10:05 +08:00
parent cb0098ec85
commit f04017e05b
4 changed files with 85 additions and 61 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ export const mkdirpInVault = async (thePath: string, vault: Vault) => {
* @param b Buffer
* @returns ArrayBuffer
*/
export const bufferToArrayBuffer = (b: Buffer) => {
export const bufferToArrayBuffer = (b: Buffer | Uint8Array) => {
return b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength);
};