Skip to content

Commit

Permalink
Revert #107 (#127)
Browse files Browse the repository at this point in the history
This PR reverts the changes from #107.
It should solve #126 / #125
  • Loading branch information
Spomky authored Jan 6, 2019
1 parent 1438831 commit 68c70d3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/OTP.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,13 @@ private function getDecodedSecret(): string
*/
private function intToByteString(int $int): string
{
return pack('J', $int);
$result = [];
while (0 !== $int) {
$result[] = chr($int & 0xFF);
$int >>= 8;
}

return str_pad(implode(array_reverse($result)), 8, "\000", STR_PAD_LEFT);
}

/**
Expand Down

0 comments on commit 68c70d3

Please sign in to comment.