docx
    Preparing search index...

    Function shortHexNumber

    • Validates a short hexadecimal number (2 bytes / 4 characters).

      Reference: ST_ShortHexNumber in OOXML specification

      Parameters

      • val: string

        The hexadecimal string to validate

      Returns string

      The validated hexadecimal string

      Error if the value is not a valid 4-character hex string

      const hex = shortHexNumber("AB12"); // Valid