Skip to content

Commit 4a6b7e2

Browse files
author
Christopher Smit
committed
Typo fix in authenticator validation
1 parent d509d88 commit 4a6b7e2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "A library for genrating a 2 factor authentication QR code",
44
"type": "library",
55
"license": "MIT",
6-
"version": "1.0",
6+
"version": "1.0.1",
77
"minimum-stability": "stable",
88
"authors": [
99
{

src/OtpAuthenticator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function getCode(string $secret, ?DateTimeInterface $time = null): string
9494

9595
$truncatedHash = $this->hashToInt($hash, $offset) & 0x7FFFFFFF;
9696

97-
return str_pad((string) ($truncatedHash % $this->pinModulo), $this->passCodeLength, '0', \STR_PAD_LEFT);
97+
return str_pad((string) ($truncatedHash % $this->pinModulo), $this->codeLength, '0', \STR_PAD_LEFT);
9898
}
9999

100100
public function newSecret(): string

0 commit comments

Comments
 (0)