Skip to content

ToFixedBytesOptions

Algorand TypeScript


Algorand TypeScript / index / <internal> / ToFixedBytesOptions

ToFixedBytesOptions<TLength> = object

Defined in: primitives.ts:101

TLength extends uint64 = uint64

length: TLength

Defined in: primitives.ts:105

The length for the bounded type


optional strategy: "assert-length" | "unsafe-cast"

Defined in: primitives.ts:114

The strategy to use for converting to a fixed length bytes type (default: ‘assert-length’)

  • ‘assert-length’: Asserts that the byte sequence has the specified length and fails if it differs
  • ‘unsafe-cast’: Reinterprets the byte sequence as a fixed length type without any checks. This will succeed even if the value is not of the specified length but will result in undefined behaviour for any code that makes use of this value.