AsHex
Conversion functions AsHex
syntax
- AsHex(a)
definition
AsHex(a) results in a string Data item with the hexadecimal representation of data item a.
applies to
- data item with uint4, uint8, uint16, uint32, uint64, or string Value type
- for integers, the resulting strings always have a size based on the number of bits in the argument divided by 4
- for strings, the resulting string size is always the input size in bytes times 2.
since version
5.40, for uint32 and string; uint4, uint8, uint16 and uint64, and a result with a fixed number of digits for integers, since 7.408
example
attribute<uint8> A8 (ADomain) : [ 0, 1, 11, 100, 255];
attribute<uint32> A32 (ADomain) := uint32(A8);
attribute<string> AsHexA (ADomain) := AsHex(A32);
attribute<string> AsHexB (ADomain) := AsHex(A8);
| A8 | AsHexA | AsHexB |
|---|---|---|
| 0 | ‘00000000’ | ‘00’ |
| 1 | ‘00000001’ | ‘01’ |
| 11 | ‘0000000B’ | ‘0B’ |
| 100 | ‘00000064’ | ‘64’ |
| 255 | ‘FFFFFFFF’ | ‘FF’ |
ADomain, nr of rows = 5