(input: {
ip: string;
userAgent: string;
userId: string;
})
| 53 | } |
| 54 | |
| 55 | export function getDeviceHash(input: { |
| 56 | ip: string; |
| 57 | userAgent: string; |
| 58 | userId: string; |
| 59 | }) { |
| 60 | return Buffer.from( |
| 61 | sodium.crypto_generichash( |
| 62 | 16, |
| 63 | `${input.ip} ${input.userAgent}`, |
| 64 | nanoidToBytes(input.userId), |
| 65 | ), |
| 66 | ); |
| 67 | } |
| 68 | |
| 69 | // User rehashed login hash |
| 70 |
no test coverage detected