Skip to content

Commit 4833262

Browse files
committed
Add @cwasm/openbsd-bcrypt and @cwasm/openwall-bcrypt to benchmark
1 parent 43a40ea commit 4833262

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

packages/bcrypt/benchmark/bcrypt.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
const { cpus } = require('os')
22

3+
const openbsd = require('@cwasm/openbsd-bcrypt')
4+
const openwall = require('@cwasm/openwall-bcrypt')
35
const { hashSync, hash, compare, genSaltSync } = require('bcrypt')
46
const { hashSync: hashSyncJs, hash: hashJs, compare: compareJs, genSaltSync: genSaltSyncJs } = require('bcryptjs')
57
const { Suite } = require('benchmark')
@@ -110,6 +112,12 @@ runAsync()
110112
.add('bcryptjs', () => {
111113
hashSyncJs(password, 12)
112114
})
115+
.add('wasm OpenBSD', () => {
116+
openbsd.hashSync(password, 12)
117+
})
118+
.add('wasm Openwall', () => {
119+
openwall.hashSync(password, 12)
120+
})
113121
.on('cycle', function (event) {
114122
console.info(String(event.target))
115123
})
@@ -132,6 +140,12 @@ runAsync()
132140
.add('bcryptjs', () => {
133141
genSaltSyncJs(10)
134142
})
143+
.add('wasm OpenBSD', () => {
144+
openbsd.genSaltSync(10)
145+
})
146+
.add('wasm Openwall', () => {
147+
openwall.genSaltSync(10)
148+
})
135149
.on('cycle', function (event) {
136150
console.info(String(event.target))
137151
})

packages/bcrypt/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@
6767
"url": "https://github.com/napi-rs/node-rs/issues"
6868
},
6969
"devDependencies": {
70+
"@cwasm/openbsd-bcrypt": "^0.1.0",
71+
"@cwasm/openwall-bcrypt": "^0.1.0",
7072
"@types/bcrypt": "^5.0.0",
7173
"bcrypt": "^5.1.0",
7274
"bcryptjs": "^2.4.3"

yarn.lock

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,20 @@ __metadata:
4141
languageName: node
4242
linkType: hard
4343

44+
"@cwasm/openbsd-bcrypt@npm:^0.1.0":
45+
version: 0.1.0
46+
resolution: "@cwasm/openbsd-bcrypt@npm:0.1.0"
47+
checksum: e1245b874b2dc5e4ca94ae39cf42b40b5e5963bd484357b3d60d3802fef5d6e3ba1e886a277e1a14ef722ee8a40e464b036695db25c7fd37cb82bff8d03cfeec
48+
languageName: node
49+
linkType: hard
50+
51+
"@cwasm/openwall-bcrypt@npm:^0.1.0":
52+
version: 0.1.0
53+
resolution: "@cwasm/openwall-bcrypt@npm:0.1.0"
54+
checksum: 1272e86a32e388ab9e333d16c57afb5cb3005bb829a317142ddc34ecc4041fe5bc52b42e0f04691852de77e9fb0a4e9427defa41d0b1fe76204d726137e4faef
55+
languageName: node
56+
linkType: hard
57+
4458
"@eslint/eslintrc@npm:^1.4.1":
4559
version: 1.4.1
4660
resolution: "@eslint/eslintrc@npm:1.4.1"
@@ -1017,6 +1031,8 @@ __metadata:
10171031
version: 0.0.0-use.local
10181032
resolution: "@node-rs/bcrypt@workspace:packages/bcrypt"
10191033
dependencies:
1034+
"@cwasm/openbsd-bcrypt": ^0.1.0
1035+
"@cwasm/openwall-bcrypt": ^0.1.0
10201036
"@types/bcrypt": ^5.0.0
10211037
bcrypt: ^5.1.0
10221038
bcryptjs: ^2.4.3

0 commit comments

Comments
 (0)