( recoveryCode: string, hashedRecoveryCode: Uint8Array, )
| 170 | ); |
| 171 | } |
| 172 | export function verifyRecoveryCode( |
| 173 | recoveryCode: string, |
| 174 | hashedRecoveryCode: Uint8Array, |
| 175 | ) { |
| 176 | const salt = hashedRecoveryCode.slice(0, 16); |
| 177 | |
| 178 | return sodium.memcmp( |
| 179 | hashedRecoveryCode.slice(16), |
| 180 | hashRecoveryCode(recoveryCode, salt).slice(16), |
| 181 | ); |
| 182 | } |
no test coverage detected