(storedKey: string, suppliedKey: string)
| 27 | * @returns {boolean} |
| 28 | */ |
| 29 | export const compareKeys = (storedKey: string, suppliedKey: string): boolean => { |
| 30 | const [hashedPassword, salt] = storedKey.split('.') |
| 31 | const buffer = scryptSync(suppliedKey, salt, 64) as Buffer |
| 32 | return timingSafeEqual(Buffer.from(hashedPassword, 'hex'), buffer) |
| 33 | } |
no outgoing calls
no test coverage detected