Pudu programming language
Menu

Std.Bytes.decodeHex

1 declaration

fn

decodeHex: Str -> Result[Bytes, Std.Bytes.BytesError]

This is a callable function.

What it does

The bytes hexadecimal text spells, or why it spells none.

An odd number of digits is a length error rather than a digit error: the

digits may all be valid and the text still not name a whole number of bytes.

The digits are walked in order rather than reached by position, because

reaching a character by position walks the text before it. A bad digit is

reported at the start of its pair.

Read the signature

  • The text after the name is the type checked by Pudu.
  • Read arrows from left to right: inputs come first, and the final type is returned.
  • Names inside [ ] are type arguments, such as the item type held by a collection.
  • Result makes success and recoverable failure part of the function's type.

Back to Std.BytesSearch related declarations