# byte_array.from_hex · Rell standard library · Chromia Docs (concept)

> pure static function from_ hex(value: text ): byte_array Create a byte array from a hexadecimal string. The given hexadecimal string must have even length,

Source: https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/byte_array/from_hex/

FUNCTION

# byte\_array.from\_hex

```signature
pure static function from_hex(value: text): byte_array
```

Create a byte array from a hexadecimal string.

The given hexadecimal string must have even length, since two hexadecimal characters encode one
byte.

**Parameters**

* **value** — the hexadecimal string

**Throws**

* `exception` — if `value` has odd length or contains invalid characters

Since 0.9.0

[View this page on docs.chromia.com](https://docs.chromia.com/pages/rell-stdlib/-rell%20-system%20-library/%5Broot%5D/byte_array/from_hex.html)Generated API reference, mirrored from the live docs
