fix: update documentation and configuration files

This commit is contained in:
2026-03-29 19:26:50 -07:00
parent 00aa8cf044
commit 26d9c7e79e
50 changed files with 6264 additions and 2627 deletions
+16
View File
@@ -0,0 +1,16 @@
import { scrypt } from "@noble/hashes/scrypt";
import { hex } from "@better-auth/utils/hex";
const config = { N: 16384, r: 16, p: 1, dkLen: 64 };
function hashPassword(password) {
const salt = hex.encode(crypto.getRandomValues(new Uint8Array(16)));
const key = scrypt(password.normalize("NFKC"), salt, {
N: config.N, p: config.p, r: config.r, dkLen: config.dkLen,
maxmem: 128 * config.N * config.r * 2
});
return `${salt}:${hex.encode(key)}`;
}
const hashed = hashPassword("admin");
console.log("Hash for 'admin':", hashed);