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