MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / generateSalt

Function generateSalt

packages/utilities/src/password.ts:3–5  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1import { createHmac, randomBytes, timingSafeEqual } from 'crypto';
2
3export function generateSalt(): string {
4 return randomBytes(16).toString('hex');
5}
6
7export function generateHash(password: string, salt: string): string {
8 const hash = createHmac('sha512', salt);

Callers 2

password.spec.tsFile · 0.90
createAuthMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected