Skip to content

algopy_testing.primitives.fixed_bytes

FixedBytesA statically-sized byte sequence, where the length is known at compile time.

Bases: algopy_testing.protocols.BytesBacked, Generic[_TBytesLength]

A statically-sized byte sequence, where the length is known at compile time.

Unlike Bytes, FixedBytes has a fixed length specified via a type parameter.

Example: : FixedBytes[typing.Literal[32]] # A 32-byte fixed-size bytes value

Returns the specified length of the FixedBytes.

classmethod from_base32(value: str) → Self

Section titled “classmethod from_base32(value: str) → Self”

Creates FixedBytes from a base32 encoded string e.g. FixedBytes.from_base32(“74======”)

classmethod from_base64(value: str) → Self

Section titled “classmethod from_base64(value: str) → Self”

Creates FixedBytes from a base64 encoded string e.g. FixedBytes.from_base64(“RkY=”)

Creates FixedBytes from a hex/octal encoded string e.g. FixedBytes.from_hex(“FF”)

Construct an instance from the underlying bytes (no validation)

Get the underlying Bytes.