bytes
@algorandfoundation/algorand-typescript
@algorandfoundation/algorand-typescript / index / bytes
Type Alias: bytes
bytes:
object
Defined in: packages/algo-ts/src/primitives.ts:101
A sequence of zero or more bytes (ie. byte[])
Type declaration
length
readonly
length:uint64
Retrieve the length of the byte sequence
at()
Retrieve the byte at the index i
Parameters
i
The index to read. Can be negative to read from the end
Returns
The byte found at the index, or an empty bytes value
bitwiseAnd()
Perform a bitwise AND operation with this bytes value and another bytes value.
The shorter of the two values will be zero-left extended to the larger length.
Parameters
other
The other bytes value
Returns
The bitwise operation result
bitwiseInvert()
Perform a bitwise INVERT operation with this bytes value
Returns
The bitwise operation result
bitwiseOr()
Perform a bitwise OR operation with this bytes value and another bytes value
The shorter of the two values will be zero-left extended to the larger length.
Parameters
other
The other bytes value
Returns
The bitwise operation result
bitwiseXor()
Perform a bitwise XOR operation with this bytes value and another bytes value.
The shorter of the two values will be zero-left extended to the larger length.
Parameters
other
The other bytes value
Returns
The bitwise operation result
concat()
Concatenate this bytes value with another bytes value
Parameters
other
The other bytes value
Returns
The concatenation result
equals()
Compares this bytes value with another.
Parameters
other
The other bytes value
Returns
boolean
True if both values represent the same byte sequence
slice()
Call Signature
Returns a copy of this bytes sequence
Returns
Call Signature
Returns a slice of this bytes sequence from the specified start to the end
Parameters
start
The index to start slicing from. Can be negative to count from the end.
Returns
Call Signature
Returns a slice of this bytes sequence from the specified start to the specified end
Parameters
start
The index to start slicing from. Can be negative to count from the end.
end
The index to end the slice. Can be negative to count from the end.
Returns
toString()
Interpret this byte sequence as a utf-8 string
Returns
string