
Product
Socket Firewall Now Blocks Malicious VS Code and Open VSX Extensions
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.
@node-rs/bcrypt
Advanced tools
@node-rs/bcrypt
π Fastest bcrypt in Node.js
export const DEFAULT_COST: 12
export function hashSync(password: string | Buffer, round?: number): string
export function hash(password: string | Buffer, round?: number): Promise<string>
export function verifySync(password: string | Buffer, hash: string | Buffer): boolean
export function verify(password: string | Buffer, hash: string | Buffer): Promise<boolean>
/**
* The same with `verifySync`
*/
export function compareSync(password: string | Buffer, hash: string | Buffer): boolean
/**
* The same with `verify`
*/
export function compare(password: string | Buffer, hash: string | Buffer): Promise<boolean>
export type Version = '2a' | '2x' | '2y' | '2b'
/**
* @param version default '2b'
*/
export function genSaltSync(round: number, version?: Version): string
/**
* @param version default '2b'
*/
export function genSalt(round: number, version?: Version): Promise<string>
,MMMM. Host - xxxxxxxxxxxxxxxxxxxxxxx
.MMMMMM Machine - Mac15,9
MMMMM, Kernel - 24.0.0
.;MMMMM:' MMMMMMMMMM;. OS - macOS 15.0.1 Sequoia
MMMMMMMMMMMMNWMMMMMMMMMMM: DE - Aqua
.MMMMMMMMMMMMMMMMMMMMMMMMWM. WM - Quartz Compositor
MMMMMMMMMMMMMMMMMMMMMMMMM. Packages - 194 (Homebrew), 32 (cargo)
;MMMMMMMMMMMMMMMMMMMMMMMM: Shell - zsh
:MMMMMMMMMMMMMMMMMMMMMMMM: Terminal - warpterminal (Version v0.2024.10.23.14.49.stable_00)
.MMMMMMMMMMMMMMMMMMMMMMMMM. Resolution - 5120x2880@160fps (as 2560x1440)
MMMMMMMMMMMMMMMMMMMMMMMMMMM. 2992x1934@120fps (as 1496x967)
.MMMMMMMMMMMMMMMMMMMMMMMMMM. 2232x1512@60fps (as 1116x756)
MMMMMMMMMMMMMMMMMMMMMMMM Uptime - 1d 2h 32m
;MMMMMMMMMMMMMMMMMMMM. CPU - Apple M3 Max (16)
.MMMM,. .MMMM,. CPU Load - 16%
Memory - 50.1 GB / 134.2 GB
Battery - 78% & Discharging
Disk Space - 624.0 GB / 994.7 GB
β― yarn workspace @node-rs/bcrypt bench
Hash benchmark
βββββββββββ¬ββββββββββββββββββββ¬ββββββββββ¬ββββββββββββββββββββ¬βββββββββββ¬ββββββββββ
β (index) β Task Name β ops/sec β Average Time (ns) β Margin β Samples β
βββββββββββΌββββββββββββββββββββΌββββββββββΌββββββββββββββββββββΌβββββββββββΌββββββββββ€
β 0 β '@node-rs/bcrypt' β '20' β 49142200.63636367 β 'Β±1.08%' β 11 β
β 1 β 'node bcrypt' β '20' β 49259219.81818187 β 'Β±1.35%' β 11 β
β 2 β 'bcryptjs' β '17' β 58142116.79999998 β 'Β±0.36%' β 10 β
β 3 β 'wasm OpenBSD' β '17' β 58318899.99999994 β 'Β±0.23%' β 10 β
β 4 β 'wasm Openwall' β '18' β 53324629.20000016 β 'Β±0.37%' β 10 β
βββββββββββ΄ββββββββββββββββββββ΄ββββββββββ΄ββββββββββββββββββββ΄βββββββββββ΄ββββββββββ
Verify benchmark
βββββββββββ¬ββββββββββββββββββββ¬ββββββββββ¬βββββββββββββββββββββ¬βββββββββββ¬ββββββββββ
β (index) β Task Name β ops/sec β Average Time (ns) β Margin β Samples β
βββββββββββΌββββββββββββββββββββΌββββββββββΌβββββββββββββββββββββΌβββββββββββΌββββββββββ€
β 0 β '@node-rs/bcrypt' β '5' β 192946879.09999993 β 'Β±0.52%' β 10 β
β 1 β 'node bcrypt' β '5' β 199806404.2 β 'Β±0.36%' β 10 β
β 2 β 'bcryptjs' β '4' β 231329516.79999986 β 'Β±0.13%' β 10 β
βββββββββββ΄ββββββββββββββββββββ΄ββββββββββ΄βββββββββββββββββββββ΄βββββββββββ΄ββββββββββ
GenSalt benchmark
βββββββββββ¬ββββββββββββββββββββ¬ββββββββββββββ¬βββββββββββββββββββββ¬βββββββββββ¬ββββββββββ
β (index) β Task Name β ops/sec β Average Time (ns) β Margin β Samples β
βββββββββββΌββββββββββββββββββββΌββββββββββββββΌβββββββββββββββββββββΌβββββββββββΌββββββββββ€
β 0 β '@node-rs/bcrypt' β '4,421,897' β 226.14727567195578 β 'Β±0.08%' β 2210949 β
β 1 β 'node bcrypt' β '4,477,408' β 223.34345972377827 β 'Β±0.08%' β 2238705 β
β 2 β 'bcryptjs' β '821,556' β 1217.2015511950851 β 'Β±0.39%' β 410779 β
β 3 β 'wasm OpenBSD' β '3,685,603' β 271.3259889021118 β 'Β±0.23%' β 1842802 β
β 4 β 'wasm Openwall' β '1,462,251' β 683.8769076754866 β 'Β±2.50%' β 731126 β
βββββββββββ΄ββββββββββββββββββββ΄ββββββββββββββ΄βββββββββββββββββββββ΄βββββββββββ΄ββββββββββ
FAQs
Rust bcrypt binding
The npm package @node-rs/bcrypt receives a total of 157,264 weekly downloads. As such, @node-rs/bcrypt popularity was classified as popular.
We found that @node-rs/bcrypt demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.Β It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.

Research
More than 140 Mastra npm packages were compromised in a supply chain attack that used a typosquatted dependency to deliver a cross-platform infostealer during installation.

Research
/Security News
A new npm package tests AI malware scanners with prompt injection, safety-triggering comments, context flooding, and obfuscated JavaScript.