Skip to content

@bytes

Convert a value to hex bytes, force UTF-8 encoding, or perform a bitwise operation.

Returns: bytes

@bytes(a b? c?)
Name Type Description
a any Value to convert or left operand
[b] string Operator (& `
[c] any Right operand for bitwise ops
# Convert a number to bytes
set $b @bytes(0xff)
# Bitwise AND
set $b @bytes(0xff00 "&" 0x0ff0)
# Left shift
set $b @bytes(0x01 "<<" 8)