Algorand TypeScript
    Preparing search index...

    Type Alias ToFixedBytesOptions<TLength>

    type ToFixedBytesOptions<TLength extends uint64 = uint64> = {
        length: TLength;
        strategy?: "assert-length" | "unsafe-cast";
    }

    Type Parameters

    Index

    Properties

    Properties

    length: TLength

    The length for the bounded type

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

    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.