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

> pure function to_ bytes(): byte_array Convert this big_integer to a byte array. The first bit of the generated byte array represents the sign (two's comple

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

FUNCTION

# big\_integer.to\_bytes

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

Convert this `big_integer` to a byte array.

The first bit of the generated byte array represents the sign (two's complement), and for subsequent
bits, more significant bits are on the left and less significant bits are on the left (big-endian).

Inverse of `big_integer.from_bytes()`.

Examples:

* `0L.to_bytes()` returns `x'00'`
* `(-1L).to_bytes()` returns `x'FF'`
* `1L.to_bytes()` returns `x'01'`
* `2L.pow(100).to_bytes()` returns `x'10000000000000000000000000'`

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.html)Generated API reference, mirrored from the live docs
