# big_integer.to_bytes_unsigned · Rell standard library · Chromia Docs (concept)

> pure function to_ bytes_ unsigned(): byte_array Convert this non-negative big_integer to a byte array, with no sign bit. The generated byte array has more 

Source: https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/big_integer/to_bytes_unsigned/

FUNCTION

# big\_integer.to\_bytes\_unsigned

```signature
pure function to_bytes_unsigned(): byte_array
```

Convert this non-negative `big_integer` to a byte array, with no sign bit.

The generated byte array has more significant bits on the left and less significant bits on the
right (big-endian).

Inverse of `big_integer.from_bytes_unsigned()`.

When this `big_integer` is equal to `0`, the empty byte array `x''` is returned (this is consistent
with the inverse function `big_integer.from_bytes_unsigned()`, which interprets `x''` as `0`).

Examples:

* `0L.to_bytes_unsigned()` returns `x''`
* `(-1L).to_bytes_unsigned()` throws an exception
* `1L.to_bytes_unsigned()` returns `x'01'`
* `2L.pow(100).to_bytes_unsigned()` returns `x'10000000000000000000000000'`

**Throws**

* `exception` — if this `big_integer` is negative

Since 0.12.0

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