encode_hex
encode_hex codifica un buffer o una stringa come stringa esadecimale con
prefisso 0x.
Input
| Nome | Tipo | Descrizione |
|---|---|---|
value | buffer, string, addon | Il buffer o la stringa da codificare. Le stringhe che iniziano con '0x' vengono decodificate come hex; altrimenti vengono utilizzati i byte UTF-8 grezzi. |
Output
| Nome | Tipo | Descrizione |
|---|---|---|
value | string | L'input nella sua rappresentazione esadecimale con prefisso 0x |
output "encoded_hex" {value = encode_hex("hello, world")}// > encoded_hex: 0x68656c6c6f2c20776f726c64
decode_hex
decode_hex decodifica una stringa esadecimale e restituisce il risultato come
buffer.
Input
| Nome | Tipo | Descrizione |
|---|---|---|
hex_string | string | La stringa hex da decodificare (con o senza prefisso 0x) |
Output
| Nome | Tipo | Descrizione |
|---|---|---|
value | buffer | La stringa hex decodificata come buffer |
output "decoded_hex" {value = decode_hex("0x68656c6c6f2c20776f726c64")}// > decoded_hex: 0x68656c6c6f2c20776f726c64
Is this page helpful?