Argon2 encryption library for Deno. It uses rust-argon2 under the hood.
import { assert } from "https://deno.land/std/testing/asserts.ts";
import { hash, verify } from "https://deno.land/x/argon2/mod.ts"
let hash = await hash("test");
assert(await verify(hash, "test"));
-
hash(password: string, options: HashOptions): Promise<string>
-
verify(hash: string, password: string): Promise<boolean>
In case of error, all methods of this library will throw an Argon2Error
type.
This library automatically download the static library and initialize Deno plugin via plugin_prepare and it requires --allow-read .deno_plugins
, --allow-write .deno_plugins
and --allow-plugin
to be specified.
deno \
--allow-read .deno_plugins \
--allow-write .deno_plugins \
--allow-plugin \
src/mod.ts
In the examples/
folder there you can find some usage examples.
To run examples you must
--allow-run
since dev environment builds and initialize the Rust crate.
src/
native/
tests/
benches/
examples/