# ByteVector
ByteVector
is a data type for byte array.
To assign a value to a ByteVector
variable, you can use a string in Base16 (opens new window), Base58 (opens new window), or Base64 (opens new window) with the appropriate prefix:
let a = base16'52696465'
let b = base58'8t38fWQhrYJsqxXtPpiRCEk1g5RJdq9bG5Rkr2N7mDFC'
let c = base64'UmlkZQ=='
This method, unlike the fromBase16String, fromBase58String, and fromBase64String functions, does not increase the complexity of the script, since decoding is performed by the compiler.
To convert integer, boolean and string values to a byte array use toBytes function:
let a = 42.toBytes()
let b = true.toBytes()
let c = "Ride".toBytes()
For more byte array functions, see the Built-in Functions.
# Limitations
The maximum size of a ByteVector
variable is:
For Standard library version 3 — 65,536 bytes.
For Standard library version 4 — 32,767 bytes.
Exception: the
bodyBytes
field of transaction structure. You can pass this value as an argument to thersaVerify
иsigVerify
verification functions (but cannot concatenate with other byte arrays in case the limit is exceeded).