The bytes array length must be a multiple of 31. If padding is added, it will need to be manually removed
after decoding.
Encoding
Each 31-byte chunk is interpreted as a big-endian integer and stored in a Field. For input [1, 10, 3, ..., 0]
(31 bytes), the resulting Field is 1 * 256^30 + 10 * 256^29 + 3 * 256^28 + ... + 0.
Encodes an array of bytes as fields.
Use
decode_bytes_from_fieldsto recover the original bytes.The
bytesarray length must be a multiple of 31. If padding is added, it will need to be manually removed after decoding.Encoding
Each 31-byte chunk is interpreted as a big-endian integer and stored in a
Field. For input[1, 10, 3, ..., 0](31 bytes), the resultingFieldis1 * 256^30 + 10 * 256^29 + 3 * 256^28 + ... + 0.