declare const SESSION_MAX_AGE: number; interface PasswordHash { salt: string; hash: string; } /** scrypt-hash a password. Pass an existing salt to verify. */ declare function hashPassword(password: string, salt?: string): PasswordHash; /** Constant-time password check. */ declare function verifyPassword(password: string, salt: string, hash: string): boolean; /** Make a signed session token carrying `uid` and an expiry. */ declare function makeToken(uid: string, secret: string, maxAgeSeconds?: number): string; /** Verify a token; returns the uid or null if invalid/expired/tampered. */ declare function verifyToken(token: string, secret: string): string | null; /** Generate a random user id. */ declare function newUserId(bytes?: number): string; export { SESSION_MAX_AGE, hashPassword, makeToken, newUserId, verifyPassword, verifyToken }; export type { PasswordHash };