(apiKey: string)
| 15 | * @returns {string} |
| 16 | */ |
| 17 | export const generateSecretHash = (apiKey: string): string => { |
| 18 | const salt = randomBytes(8).toString('hex') |
| 19 | const buffer = scryptSync(apiKey, salt, 64) as Buffer |
| 20 | return `${buffer.toString('hex')}.${salt}` |
| 21 | } |
| 22 | |
| 23 | /** |
| 24 | * Verify valid keys |
no outgoing calls
no test coverage detected