diff --git a/src/Hash/BuiltinHash.php b/src/Hash/BuiltinHash.php index 3dbd657..d0a928c 100644 --- a/src/Hash/BuiltinHash.php +++ b/src/Hash/BuiltinHash.php @@ -1,6 +1,7 @@ hashName, \hash_hmac_algos())) ? : throw \ValueError( + (\array_search(\strtolower($this->hashName), \hash_hmac_algos())) ? : throw new \ValueError( $this->hashName . " is not the name of a built-in hash function"); } diff --git a/src/HashConfig.php b/src/HashConfig.php index d2a1758..2254a1e 100644 --- a/src/HashConfig.php +++ b/src/HashConfig.php @@ -20,9 +20,9 @@ class HashConfig public int $digits=6 ) { - if (\is_string($this->hash)) + if (\is_string($this->algorithm)) { - $this->hash = new BuiltinHash($this->hash); + $this->algorithm = new BuiltinHash($this->algorithm); } } diff --git a/src/Logger/Base.php b/src/Logger/Base.php index a4d4a0e..3ebd354 100644 --- a/src/Logger/Base.php +++ b/src/Logger/Base.php @@ -1,51 +1,53 @@