mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-01-14 00:27:55 +00:00
Docs: Update benchmark results
This commit is contained in:
@@ -4,4 +4,6 @@ async function hashPassword(p, s) {
|
||||
const h = await scrypt(e.encode(p), e.encode(s), 1024, 8, 1, 32)
|
||||
return [...h].map(b => b.toString(16).padStart(2, '0')).join('')
|
||||
}
|
||||
export default hashPassword;
|
||||
export default hashPassword;
|
||||
// Generation time: 2.609s
|
||||
// Result: PASS
|
||||
@@ -1,9 +1,9 @@
|
||||
async function hashPassword(password, salt) {
|
||||
const { scrypt } = await import('https://cdn.jsdelivr.net/npm/scrypt-js@3.0.1/+esm');
|
||||
const encoder = new TextEncoder();
|
||||
const enc = new TextEncoder();
|
||||
const hash = await scrypt(
|
||||
encoder.encode(password),
|
||||
encoder.encode(salt),
|
||||
enc.encode(password),
|
||||
enc.encode(salt),
|
||||
1024,
|
||||
8,
|
||||
1,
|
||||
@@ -11,4 +11,6 @@ async function hashPassword(password, salt) {
|
||||
);
|
||||
return Array.from(hash, b => b.toString(16).padStart(2, '0')).join('');
|
||||
}
|
||||
export default hashPassword;
|
||||
export default hashPassword;
|
||||
// Generation time: 2.743s
|
||||
// Result: PASS
|
||||
@@ -1,19 +0,0 @@
|
||||
const hashPassword = async (password, salt) => {
|
||||
const { scrypt } = await import('https://esm.sh/scrypt-js@3.0.1');
|
||||
|
||||
const encoder = new TextEncoder();
|
||||
|
||||
const hashBytes = await scrypt(
|
||||
encoder.encode(password),
|
||||
encoder.encode(salt),
|
||||
1024,
|
||||
8,
|
||||
1,
|
||||
32
|
||||
);
|
||||
|
||||
return [...hashBytes]
|
||||
.map(b => b.toString(16).padStart(2, '0'))
|
||||
.join('');
|
||||
};
|
||||
export default hashPassword;
|
||||
@@ -2,6 +2,8 @@ const hashPassword = async (p, s) => {
|
||||
const { scrypt } = await import('https://esm.sh/scrypt-js')
|
||||
const e = new TextEncoder()
|
||||
const h = await scrypt(e.encode(p), e.encode(s), 1024, 8, 1, 32)
|
||||
return [...h].map(b => b.toString(16).padStart(2, '0')).join('')
|
||||
return Array.from(h).map(b => b.toString(16).padStart(2, '0')).join('')
|
||||
}
|
||||
export default hashPassword;
|
||||
export default hashPassword;
|
||||
// Generation time: 18.084s
|
||||
// Result: PASS
|
||||
@@ -1,9 +1,9 @@
|
||||
async function hashPassword(password, salt) {
|
||||
const { default: scrypt } = await import('https://cdn.jsdelivr.net/npm/scrypt-js@3.0.1/index.js');
|
||||
const e = new TextEncoder();
|
||||
const p = e.encode(password);
|
||||
const s = e.encode(salt);
|
||||
const h = await scrypt(p, s, 1024, 8, 1, 32);
|
||||
return [...h].map(b => b.toString(16).padStart(2, '0')).join('');
|
||||
const { scrypt } = await import('https://cdn.jsdelivr.net/npm/scrypt-js@3.0.1/dist/scrypt.min.js');
|
||||
const enc = new TextEncoder();
|
||||
const buf = await scrypt(enc.encode(password), enc.encode(salt), 1024, 8, 1, 32);
|
||||
return Array.from(buf, b => b.toString(16).padStart(2, '0')).join('');
|
||||
}
|
||||
export default hashPassword;
|
||||
export default hashPassword;
|
||||
// Generation time: 39.100s
|
||||
// Result: FAIL
|
||||
@@ -1,7 +1,9 @@
|
||||
const e=new TextEncoder
|
||||
const hashPassword=async(p,s)=>{
|
||||
const{ scrypt }=await import('https://cdn.skypack.dev/scrypt-js')
|
||||
const {scrypt}=await import('https://cdn.skypack.dev/scrypt-js')
|
||||
const e=new TextEncoder
|
||||
const h=await scrypt(e.encode(p),e.encode(s),1024,8,1,32)
|
||||
return Array.from(h,x=>(x+256).toString(16).slice(-2)).join('')
|
||||
return [...h].map(b=>b.toString(16).padStart(2,'0')).join('')
|
||||
}
|
||||
export default hashPassword;
|
||||
export default hashPassword;
|
||||
// Generation time: 8.405s
|
||||
// Result: PASS
|
||||
@@ -1,12 +0,0 @@
|
||||
const hashPassword = async (password, salt) => {
|
||||
const { scrypt } = await import('https://cdn.jsdelivr.net/npm/scrypt-js@3.0.1/scrypt.min.js')
|
||||
const encoder = new TextEncoder()
|
||||
const passwordBytes = encoder.encode(password)
|
||||
const saltBytes = encoder.encode(salt)
|
||||
|
||||
const hashBytes = await scrypt(passwordBytes, saltBytes, 1024, 8, 1, 32)
|
||||
return Array.from(hashBytes)
|
||||
.map(b => b.toString(16).padStart(2, '0'))
|
||||
.join('')
|
||||
}
|
||||
export default hashPassword;
|
||||
@@ -1,9 +0,0 @@
|
||||
async function hashPassword(password, salt) {
|
||||
const { scrypt } = await import('https://cdn.skypack.dev/scrypt-js');
|
||||
const e = new TextEncoder();
|
||||
const pw = e.encode(password);
|
||||
const s = e.encode(salt);
|
||||
const h = await scrypt(pw, s, 1024, 8, 1, 32);
|
||||
return Array.from(h).map(b=>b.toString(16).padStart(2,'0')).join('');
|
||||
}
|
||||
export default hashPassword;
|
||||
@@ -1,9 +0,0 @@
|
||||
async function hashPassword(password, salt) {
|
||||
const { scrypt } = await import('https://cdn.skypack.dev/scrypt-js');
|
||||
const encoder = new TextEncoder();
|
||||
const pwBuf = encoder.encode(password);
|
||||
const saltBuf = encoder.encode(salt);
|
||||
const hashBuf = await scrypt(pwBuf, saltBuf, 1024, 8, 1, 32);
|
||||
return Array.from(hashBuf).map(b => b.toString(16).padStart(2, '0')).join('');
|
||||
}
|
||||
export default hashPassword;
|
||||
11
tests/10_scrypt_hash/outputs/x-ai_grok-4.js
Normal file
11
tests/10_scrypt_hash/outputs/x-ai_grok-4.js
Normal file
@@ -0,0 +1,11 @@
|
||||
async function hashPassword(password, salt) {
|
||||
const { scrypt } = await import('https://cdn.jsdelivr.net/npm/scrypt-js@3.0.1/index.js');
|
||||
const encoder = new TextEncoder();
|
||||
const passwordBytes = encoder.encode(password);
|
||||
const saltBytes = encoder.encode(salt);
|
||||
const hashBytes = await scrypt(passwordBytes, saltBytes, 1024, 8, 1, 32);
|
||||
return Array.from(hashBytes, byte => byte.toString(16).padStart(2, '0')).join('').toLowerCase();
|
||||
}
|
||||
export default hashPassword;
|
||||
// Generation time: 12.779s
|
||||
// Result: FAIL
|
||||
Reference in New Issue
Block a user