bytes
@algorandfoundation/algorand-typescript
@algorandfoundation/algorand-typescript / index / bytes
Type Alias: bytes
Section titled “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
Section titled “Type declaration”length
Section titled “length”
readonlylength:uint64
Retrieve the length of the byte sequence
Retrieve the byte at the index i
Parameters
Section titled “Parameters”The index to read. Can be negative to read from the end
Returns
Section titled “Returns”The byte found at the index, or an empty bytes value
bitwiseAnd()
Section titled “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
Section titled “Parameters”The other bytes value
Returns
Section titled “Returns”The bitwise operation result
bitwiseInvert()
Section titled “bitwiseInvert()”Perform a bitwise INVERT operation with this bytes value
Returns
Section titled “Returns”The bitwise operation result
bitwiseOr()
Section titled “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
Section titled “Parameters”The other bytes value
Returns
Section titled “Returns”The bitwise operation result
bitwiseXor()
Section titled “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
Section titled “Parameters”The other bytes value
Returns
Section titled “Returns”The bitwise operation result
concat()
Section titled “concat()”Concatenate this bytes value with another bytes value
Parameters
Section titled “Parameters”The other bytes value
Returns
Section titled “Returns”The concatenation result
equals()
Section titled “equals()”Compares this bytes value with another.
Parameters
Section titled “Parameters”The other bytes value
Returns
Section titled “Returns”boolean
True if both values represent the same byte sequence
slice()
Section titled “slice()”Call Signature
Section titled “Call Signature”Returns a copy of this bytes sequence
Returns
Section titled “Returns”Call Signature
Section titled “Call Signature”Returns a slice of this bytes sequence from the specified start to the end
Parameters
Section titled “Parameters”The index to start slicing from. Can be negative to count from the end.
Returns
Section titled “Returns”Call Signature
Section titled “Call Signature”Returns a slice of this bytes sequence from the specified start to the specified end
Parameters
Section titled “Parameters”The index to start slicing from. Can be negative to count from the end.
The index to end the slice. Can be negative to count from the end.
Returns
Section titled “Returns”toString()
Section titled “toString()”Interpret this byte sequence as a utf-8 string
Returns
Section titled “Returns”string