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 CashAddressSupportedLength respectively, e.g.:

    const type = 3 as CashAddressType;
    const length = 20 as CashAddressSupportedLength;
    getCashAddressVersionByte(type, length);

    For the reverse, see decodeCashAddressVersionByte.

    Parameters

    • typeBits: CashAddressAvailableTypeBits

      The address type bit of the payload being encoded.

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

      The length of the payload being encoded.

    Returns number

Generated using TypeDoc