Caravan Documentation
    Preparing search index...

    Function validateHex

    • Validate whether the given string is hex.

      • Valid hex consists of an even number of characters 'a-f, A-F, or 0-9`. This is case-insensitive.

      • The presence of the common prefix 0x will make the input be considered invalid (because of the x`).

      Parameters

      • inputString: string

      Returns
          | ""
          | "Invalid hex: odd-length string."
          | "Invalid hex: only characters a-f, A-F and 0-9 allowed."