protected static function fromHex(string $hex): string
    {
        $data = '';

        // Convert hex to string.
        for ($i = 0; $i < \strlen($hex) - 1; $i += 2) {
            $data .= \chr(\hexdec($hex[$i].$hex[$i + 1]));
        }

        return $data;
    }