bytes
Algorand TypeScript / index / bytes
bytes<
TLength> =object
Defined in: primitives.ts:121
A sequence of zero or more bytes (ie. byte[])
Type Parameters
Section titled “Type Parameters”TLength
Section titled “TLength”TLength extends uint64 = uint64
The static length of this byte array
Properties
Section titled “Properties”length
Section titled “length”
readonlylength:uint64
Defined in: primitives.ts:125
Retrieve the length of the byte sequence
Methods
Section titled “Methods”at(
i):bytes
Defined in: primitives.ts:132
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”bytes
The byte found at the index, or an empty bytes value
bitwiseAnd()
Section titled “bitwiseAnd()”Call Signature
Section titled “Call Signature”bitwiseAnd(
other):bytes<TLength>
Defined in: primitives.ts:148
Perform a bitwise AND operation with this bytes value and another bytes value of the same length.
Parameters
Section titled “Parameters”bytes<TLength>
The other bytes value
Returns
Section titled “Returns”bytes<TLength>
The bitwise operation result
Call Signature
Section titled “Call Signature”bitwiseAnd(
other):bytes
Defined in: primitives.ts:157
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”bytes
The bitwise operation result
bitwiseInvert()
Section titled “bitwiseInvert()”bitwiseInvert():
bytes<TLength>
Defined in: primitives.ts:199
Perform a bitwise INVERT operation with this bytes value
Returns
Section titled “Returns”bytes<TLength>
The bitwise operation result
bitwiseOr()
Section titled “bitwiseOr()”Call Signature
Section titled “Call Signature”bitwiseOr(
other):bytes<TLength>
Defined in: primitives.ts:166
Perform a bitwise OR operation with this bytes value and another bytes value of the same length.
Parameters
Section titled “Parameters”bytes<TLength>
The other bytes value
Returns
Section titled “Returns”bytes<TLength>
The bitwise operation result
Call Signature
Section titled “Call Signature”bitwiseOr(
other):bytes
Defined in: primitives.ts:175
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”bytes
The bitwise operation result
bitwiseXor()
Section titled “bitwiseXor()”Call Signature
Section titled “Call Signature”bitwiseXor(
other):bytes<TLength>
Defined in: primitives.ts:184
Perform a bitwise XOR operation with this bytes value and another bytes value of the same length.
Parameters
Section titled “Parameters”bytes<TLength>
The other bytes value
Returns
Section titled “Returns”bytes<TLength>
The bitwise operation result
Call Signature
Section titled “Call Signature”bitwiseXor(
other):bytes
Defined in: primitives.ts:193
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”bytes
The bitwise operation result
concat()
Section titled “concat()”concat(
other):bytes
Defined in: primitives.ts:139
Concatenate this bytes value with another bytes value
Parameters
Section titled “Parameters”The other bytes value
Returns
Section titled “Returns”bytes
The concatenation result
equals()
Section titled “equals()”equals(
other):boolean
Defined in: primitives.ts:206
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”slice():
bytes<TLength>
Defined in: primitives.ts:211
Returns a copy of this bytes sequence
Returns
Section titled “Returns”bytes<TLength>
Call Signature
Section titled “Call Signature”slice(
start):bytes
Defined in: primitives.ts:216
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”bytes
Call Signature
Section titled “Call Signature”slice(
start,end):bytes
Defined in: primitives.ts:222
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”bytes
toFixed()
Section titled “toFixed()”toFixed<
TNewLength>(options):bytes<TNewLength>
Defined in: primitives.ts:237
Change this unbounded bytes instance into a bounded one
Type Parameters
Section titled “Type Parameters”TNewLength
Section titled “TNewLength”TNewLength extends uint64
Parameters
Section titled “Parameters”options
Section titled “options”ToFixedBytesOptions<TNewLength>
Options for the conversion
Returns
Section titled “Returns”bytes<TNewLength>
toString()
Section titled “toString()”toString():
string
Defined in: primitives.ts:231
Interpret this byte sequence as a utf-8 string
Returns
Section titled “Returns”string