Conditions | 1 |
Paths | 1 |
Total Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
29 | protected function oathHotp(string $seed, string $counter): string |
||
30 | { |
||
31 | // Counter must be 64-bit int |
||
32 | $bin_counter = pack('N*', 0, $counter); |
||
33 | $hash = hash_hmac('sha1', $bin_counter, $seed, true); |
||
34 | |||
35 | return str_pad($this->oathTruncate($hash), $this->tokenLength, '0', STR_PAD_LEFT); |
||
36 | } |
||
37 | |||
53 |