Skip to main content
Home

latest
It is unknown whether this package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
It is unknown whether this package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score
47%
Published
a year ago (0.17.1)

BCrypt

This module provides BCrypt hashing support for deno and the web by providing simple bindings using bcrypt compiled to webassembly.

A non-wasm version is available at @blackberry/bcrypt@0.17.0/mod_polyfill.

Usage

import { hash } from "jsr:@blackberry/bcrypt@0.17.0";

const encoder = new TextEncoder();

const password = encoder.encode("very-cool-password");
const salt = encoder.encode("salty salt woo!!");

console.log(hash(password, salt));

// Should log:
// $2b$12$a0DqbFiea0DqbA/1Z06fGOZcRMnat359MTbqezYI1qXvLuOL16Eve

Comparisons

Hashing (per iter):

Cost x/bcrypt x/bcrypt_ffi @blackberry/bcrypt Relative speeds
4 14.83ms NA 1.11ms 1.00x/NA/13.35x
6 18.62ms NA 4.27ms 1.00x/NA/4.36x
8 32.05ms NA 16.93ms 1.00x/NA/1.89x
10 84.84ms NA 67.94ms 1.00x/NA/1.25x
12 298.34ms NA 270.70ms 1.00x/NA/1.10x
13 568.96ms NA 540.74ms 1.00x/NA/1.07x

Verifying (per iter):

Will get to later

Maintainers

Original bcrypt bindings by:

Other

Contribution

Pull request, issues and feedback are very welcome. Code style is formatted with deno fmt and commit messages are WERE written following Conventional Commits spec.

The author of this library is not responsible enough to use them anymore.

License

Copyright 2021, Denosaurs. All rights reserved. MIT license. Copyright 2024, Skyler Calaman. All rights reserved. MIT license.

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@blckbrry/bcrypt

Import symbol

import * as bcrypt from "@blckbrry/bcrypt";
or

Import directly with a jsr specifier

import * as bcrypt from "jsr:@blckbrry/bcrypt";

Add Package

pnpm i jsr:@blckbrry/bcrypt
or (using pnpm 10.8 or older)
pnpm dlx jsr add @blckbrry/bcrypt

Import symbol

import * as bcrypt from "@blckbrry/bcrypt";

Add Package

yarn add jsr:@blckbrry/bcrypt
or (using Yarn 4.8 or older)
yarn dlx jsr add @blckbrry/bcrypt

Import symbol

import * as bcrypt from "@blckbrry/bcrypt";

Add Package

vlt install jsr:@blckbrry/bcrypt

Import symbol

import * as bcrypt from "@blckbrry/bcrypt";

Add Package

npx jsr add @blckbrry/bcrypt

Import symbol

import * as bcrypt from "@blckbrry/bcrypt";

Add Package

bunx jsr add @blckbrry/bcrypt

Import symbol

import * as bcrypt from "@blckbrry/bcrypt";