Skip to content

Commit

Permalink
Merge pull request #4 from sc0Vu/fix-3
Browse files Browse the repository at this point in the history
Fix 3
  • Loading branch information
sc0Vu authored Jun 15, 2018
2 parents 8736ef0 + ed00c4d commit 0815348
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public function stripZero(string $value)
*/
public function isHex(string $value)
{
return (is_string($value) && preg_match('/^(0x)?[a-f0-9]+$/', $value) === 1);
return (is_string($value) && preg_match('/^(0x)?[a-fA-F0-9]+$/', $value) === 1);
}

/**
Expand Down Expand Up @@ -163,7 +163,7 @@ public function privateKeyToPublicKey(string $privateKey)
$privateKey = $this->stripZero($privateKey);

if (strlen($privateKey) !== 64) {
throw new InvalidArgumentException('Invalid public key length.');
throw new InvalidArgumentException('Invalid private key length.');
}
$privateKey = $this->secp256k1->keyFromPrivate($privateKey, 'hex');
$publicKey = $privateKey->getPublic(false, 'hex');
Expand Down

0 comments on commit 0815348

Please sign in to comment.