static public function getHashBitLength($algorithm = null)
    {
        if (!$algorithm) {
            return self::HASH_BIT_LENGTH;
        }

        if (is_integer($algorithm)) {
            // direct hash-bit-length provided
            return (int) $algorithm;
        }
        elseif (strpos(strtolower($algorithm), "keccak-") !== false) {
            $bits = (int) substr($algorithm, -3); // keccak-256, keccak-512, etc.

            if (! in_array($bits, [256, 228, 384, 512]))
                $bits = 512;

            return $bits;
        }

        return self::HASH_BIT_LENGTH;
    }