Idris2Doc : Oracle.Internal.Hex

Oracle.Internal.Hex

(source)

Definitions

hexDigit : Bits8->Char
  Convert a four-bit hexadecimal digit into its uppercase character
representation.

Values 0 through 15 are mapped to `'0'` through `'9'` and `'A'`
through `'F'`.

Values greater than 15 are treated as 15 and therefore map to `'F'`.

Totality: total
Visibility: export
hexByte : Bits8->String
  Encode a single byte as a two-character uppercase hexadecimal String.

The high four bits are encoded first, followed by the low four bits.

For example:

```text
0x00 -> "00"
0x2A -> "2A"
0xFF -> "FF"
```

Totality: total
Visibility: export
hexEncode : ListBits8->String
  Encode a list of bytes as an uppercase hexadecimal String.

Each byte is represented by exactly two hexadecimal characters, so the
resulting String has twice as many characters as the input has bytes.

This representation is safe for transporting arbitrary binary data across
String-based FFI boundaries because the resulting value contains only
ASCII hexadecimal characters.

For example:

```text
[0x00, 0xFF, 0x01, 0x80, 0x41, 0x42]
-> "00FF01804142"
```

Totality: total
Visibility: export
hexValue : Char->MaybeBits8
  Decode a hexadecimal character into its four-bit numeric value.

Both uppercase and lowercase hexadecimal characters are accepted.

Totality: total
Visibility: export
hexPair : Char->Char->MaybeBits8
  Decode two hexadecimal characters into a single byte.

Totality: total
Visibility: export
hexDecode : String->Maybe (ListBits8)
  Decode an uppercase or lowercase hexadecimal String into bytes.

Returns Nothing if the String has an odd number of characters or contains
any non-hexadecimal character.

Totality: total
Visibility: export