Skip to content

Commit 81304d1

Browse files
committed
added bencmarks
1 parent 33f2c43 commit 81304d1

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

crypto/hash.bench.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { hash, verify } from "./hash.ts";
2+
3+
Deno.bench("hash() with argon2", () => {
4+
hash("argon2", "password");
5+
});
6+
7+
Deno.bench("hash() with bcrypt", () => {
8+
hash("bcrypt", "password");
9+
});
10+
11+
Deno.bench("hash() with scrypt", () => {
12+
hash("scrypt", "password");
13+
});
14+
15+
Deno.bench("verify() with argon2", () => {
16+
verify(
17+
"argon2",
18+
"password",
19+
"$argon2id$v=19$m=19456,t=2,p=1$sgg3gflK2pkatSfTYkQTtA$UvKPnIcKDBfK9d4v4ItjRYra//s9uuFJgMisTNC+Wcw",
20+
);
21+
});
22+
23+
Deno.bench("verify() with bcrypt", () => {
24+
verify(
25+
"bcrypt",
26+
"password",
27+
"$2b$12$GUvwcP3VbNvmKDzl114sW.DVt.1xX9N7OmWk80OWLjigWIW/3n66G",
28+
);
29+
});
30+
31+
Deno.bench("verify() with scrypt", () => {
32+
verify(
33+
"scrypt",
34+
"password",
35+
"$scrypt$ln=17,r=8,p=1$y8d9gN0rKwW7z+hJb/vQAA$w+VLelvZVpZ0zt/+svlPbZFHDTl+jL5Xvp+YKrZEyKE",
36+
);
37+
});

0 commit comments

Comments
 (0)