Options
All
  • Public
  • Public/Protected
  • All
Menu

Module ast/BinaryExpr

Index

Functions

Add

BitwiseAnd

BitwiseOr

BitwiseXor

Div

Eq

Ge

GetBit

  • Get the bit value of an expression at a specific index. The meaning of index differs if value is an integer or a byte string.

    • For integers, bit indexing begins with low-order bits. For example, :code:GetBit(Int(16), Int(4)) yields 1. Any other valid index would yield a bit value of 0. Any integer less than 64 is a valid index.

    • For byte strings, bit indexing begins at the first byte. For example, :code:GetBit(Bytes("base16", "0xf0"), Int(0)) yields 1. Any index less than 4 would yield 1, and any valid index 4 or greater would yield 0. Any integer less than 8*Len(value) is a valid index.

    Requires TEAL version 3 or higher.

    Parameters

    • value: Expr

      The value containing bits. Can evaluate to any type.

    • index: Expr

      The index of the bit to extract. Must evaluate to uint64.

    Returns BinaryExpr

GetByte

  • Extract a single byte as an integer from a byte string.

    Similar to GetBit, indexing begins at the first byte. For example, :code:GetByte(Bytes("base16", "0xff0000"), Int(0)) yields 255. Any other valid index would yield 0.

    Requires TEAL version 3 or higher.

    Parameters

    • value: Expr

      The value containing the bytes. Must evaluate to bytes.

    • index: Expr

      The index of the byte to extract. Must evaluate to an integer less than Len(value).

    Returns BinaryExpr

Gt

Le

Lt

Minus

Mod

Mul

Neq

Generated using TypeDoc