MCPcopy
hub / github.com/streetwriters/notesnook / hash

Function hash

packages/sodium/tests/utils.ts:139–154  ·  view source on GitHub ↗
(crypto: ISodium)

Source from the content-addressed store, hash-verified

137}
138
139export async function hash(crypto: ISodium) {
140 await crypto.initialize();
141 const saltBytes = crypto.crypto_generichash(
142 crypto.crypto_pwhash_SALTBYTES,
143 "mysalt"
144 );
145 return crypto.crypto_pwhash(
146 32,
147 "mypassword",
148 saltBytes,
149 3, // operations limit
150 1024 * 1024 * 64, // memory limit (8MB)
151 crypto.crypto_pwhash_ALG_ARGON2ID13,
152 "base64"
153 );
154}

Callers 2

mainFunction · 0.90
compat.test.tsFile · 0.90

Calls 3

initializeMethod · 0.65
crypto_generichashMethod · 0.65
crypto_pwhashMethod · 0.65

Tested by

no test coverage detected