public static function fromBinary($bytes, ?int $minLength = null)
    {
        $bitstring = '';

        $length = strlen($bytes);
        for ($i = 0; $i < $length; $i++) {
            $bitstring .= sprintf('%08d', decbin(ord($bytes[$i])));
        }
        if ($minLength && strlen($bitstring) < $minLength) {
            $bitstring = str_pad($bitstring, $minLength, '0');
        }

        return new self($bitstring);
    }