Function encodeCashAddressVersionByte

  • Encode a CashAddress version byte for the given address type and payload length. See CashAddressVersionByte for more information.

    The type parameter must be a number between 0 and 15, and bitLength must be one of the standardized lengths. To use the contents of a variable, cast it to CashAddressType or CashAddressSize respectively, e.g.:

    const type = 3 as CashAddressType;
    const size = 160 as CashAddressSize;
    getCashAddressVersionByte(type, size);

    Parameters

    • typeBits: CashAddressAvailableTypeBits

      the address type bit of the payload being encoded

    • length: 20 | 64 | 32 | 24 | 28 | 40 | 48 | 56

      the length of the payload being encoded

    Returns number

Generated using TypeDoc