Encode a string as hexadecimal. Text containing characters above U+00FF is encoded as the UTF-8 byte order mark followed by its UTF-8 bytes, so it can be restored by the matching decode function. All other text is encoded as one byte per character.
U+00FF
The string value to encode
The hexadecimal encoded string
0.13.0
encodeAsHex("Hello"); // "48656c6c6f"encodeAsHex("A"); // "41"encodeAsHex(""); // ""encodeAsHex("€"); // "efbbbfe282ac" Copy
encodeAsHex("Hello"); // "48656c6c6f"encodeAsHex("A"); // "41"encodeAsHex(""); // ""encodeAsHex("€"); // "efbbbfe282ac"
Encode a string as hexadecimal. Text containing characters above
U+00FFis encoded as the UTF-8 byte order mark followed by its UTF-8 bytes, so it can be restored by the matching decode function. All other text is encoded as one byte per character.