update bcryptjs

This commit is contained in:
C85297 2026-05-08 16:08:48 +01:00
parent 6822bd5584
commit 197b0fa133
No known key found for this signature in database
5 changed files with 14 additions and 11 deletions

13
package-lock.json generated
View File

@ -20,7 +20,7 @@
"arrive": "^2.5.3", "arrive": "^2.5.3",
"assert": "^2.1.0", "assert": "^2.1.0",
"avsc": "^5.7.9", "avsc": "^5.7.9",
"bcryptjs": "^2.4.3", "bcryptjs": "^3.0.3",
"bignumber.js": "^9.3.1", "bignumber.js": "^9.3.1",
"blakejs": "^1.2.1", "blakejs": "^1.2.1",
"bootstrap": "4.6.2", "bootstrap": "4.6.2",
@ -5808,10 +5808,13 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/bcryptjs": { "node_modules/bcryptjs": {
"version": "2.4.3", "version": "3.0.3",
"resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz", "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-3.0.3.tgz",
"integrity": "sha512-V/Hy/X9Vt7f3BbPJEi8BdVFMByHi+jNXrYkW3huaybV/kQ0KJg0Y6PkEMbn+zeT+i+SiKZ/HMqJGIIt4LZDqNQ==", "integrity": "sha512-GlF5wPWnSa/X5LKM1o0wz0suXIINz1iHRLvTS+sLyi7XPbe5ycmYI3DlZqVGZZtDgl4DmasFg7gOB3JYbphV5g==",
"license": "MIT" "license": "BSD-3-Clause",
"bin": {
"bcrypt": "bin/bcrypt"
}
}, },
"node_modules/big.js": { "node_modules/big.js": {
"version": "5.2.2", "version": "5.2.2",

View File

@ -96,15 +96,15 @@
"@alexaltea/capstone-js": "^3.0.5", "@alexaltea/capstone-js": "^3.0.5",
"@astronautlabs/amf": "^0.0.6", "@astronautlabs/amf": "^0.0.6",
"@blu3r4y/lzma": "^2.3.3", "@blu3r4y/lzma": "^2.3.3",
"@noble/hashes": "2.2.0",
"@wavesenterprise/crypto-gost-js": "^2.1.0-RC1", "@wavesenterprise/crypto-gost-js": "^2.1.0-RC1",
"@xmldom/xmldom": "^0.8.13", "@xmldom/xmldom": "^0.8.13",
"argon2-browser": "^1.18.0", "argon2-browser": "^1.18.0",
"arrive": "^2.5.3", "arrive": "^2.5.3",
"assert": "^2.1.0", "assert": "^2.1.0",
"avsc": "^5.7.9", "avsc": "^5.7.9",
"bcryptjs": "^2.4.3", "bcryptjs": "^3.0.3",
"bignumber.js": "^9.3.1", "bignumber.js": "^9.3.1",
"@noble/hashes": "2.2.0",
"blakejs": "^1.2.1", "blakejs": "^1.2.1",
"bootstrap": "4.6.2", "bootstrap": "4.6.2",
"bootstrap-colorpicker": "^3.4.0", "bootstrap-colorpicker": "^3.4.0",

View File

@ -43,7 +43,7 @@ class Bcrypt extends Operation {
const rounds = args[0]; const rounds = args[0];
const salt = await bcrypt.genSalt(rounds); const salt = await bcrypt.genSalt(rounds);
return await bcrypt.hash(input, salt, null, p => { return await bcrypt.hash(input, salt, undefined, p => {
// Progress callback // Progress callback
if (isWorkerEnvironment()) if (isWorkerEnvironment())
self.sendStatusMessage(`Progress: ${(p * 100).toFixed(0)}%`); self.sendStatusMessage(`Progress: ${(p * 100).toFixed(0)}%`);

View File

@ -43,7 +43,7 @@ class BcryptCompare extends Operation {
async run(input, args) { async run(input, args) {
const hash = args[0]; const hash = args[0];
const match = await bcrypt.compare(input, hash, null, p => { const match = await bcrypt.compare(input, hash, undefined, p => {
// Progress callback // Progress callback
if (isWorkerEnvironment()) if (isWorkerEnvironment())
self.sendStatusMessage(`Progress: ${(p * 100).toFixed(0)}%`); self.sendStatusMessage(`Progress: ${(p * 100).toFixed(0)}%`);

View File

@ -136,8 +136,8 @@ Tiger-128`;
it("Bcrypt", async () => { it("Bcrypt", async () => {
const result = await chef.bcrypt("Put a Sock In It"); const result = await chef.bcrypt("Put a Sock In It");
const strResult = result.toString(); const strResult = result.toString();
assert.equal(strResult.length, 60); assert.match(strResult, /^\$2b\$10\$[./A-Za-z0-9]{53}$/);
assert.equal(strResult.slice(0, 7), "$2a$10$"); assert.equal(strResult.split("$").length, 4);
}), }),
it("bcryptCompare", async() => { it("bcryptCompare", async() => {