feat: add newLTHashState util

This commit is contained in:
Adhiraj Singh
2021-11-24 20:02:36 +05:30
parent 983b28ba0e
commit 920e60815b
2 changed files with 4 additions and 2 deletions

View File

@@ -95,6 +95,8 @@ const generatePatchMac = (snapshotMac: Uint8Array, valueMacs: Uint8Array[], vers
return hmacSign(total, key)
}
export const newLTHashState = (): LTHashState => ({ version: 0, hash: Buffer.alloc(128), indexValueMap: {} })
export const encodeSyncdPatch = async(
{ type, index, syncAction, apiVersion }: WAPatchCreate,
{ creds: { myAppStateKeyId }, keys }: AuthenticationState