Search... Ctrl + K

Hash Password with Random Salt (bcrypt)
One script reply has been approved by the moderators Verified

Created by rossmccrann 128 days ago Used 567 times 1 Point

Hash a password with a randomly generated salt.

No comments yet

Points: 0
deno
One script reply has been approved by the moderators
Ap­pro­ved
import * as wmill from "https://deno.land/x/windmill@v1.27.2/mod.ts";
import * as bcrypt from "https://deno.land/x/bcrypt@v0.2.4/mod.ts";

export async function main(password: string) {
  const salt = await bcrypt.genSalt();
  const hash_pass = await bcrypt.hash(password, salt);

	return hash_pass;
}

Submitted by rossmccrann 128 days ago

Edited 128 days ago

No comments yet