encoding/hex

CUE v0.18.0

Functions

Decode

cue
Decode: func(s: string) -> bytes

Decode returns the bytes represented by the hexadecimal string s.

Decode expects that s contains only hexadecimal characters and that s has even length. If the input is malformed, Decode returns the bytes decoded before the error.

DecodedLen

cue
DecodedLen: func(x: int) -> int

DecodedLen returns the length of a decoding of x source bytes. Specifically, it returns x / 2.

Dump

cue
Dump: func(data: bytes | string) -> string

Dump returns a string that contains a hex dump of the given data. The format of the hex dump matches the output of `hexdump -C` on the command line.

Encode

cue
Encode: func(src: bytes | string) -> string

Encode returns the hexadecimal encoding of src.

EncodedLen

cue
EncodedLen: func(n: int) -> int

EncodedLen returns the length of an encoding of n source bytes. Specifically, it returns n * 2.

Install CUE