Function bitwiseEncodeSemverString

  • Encodes a semantic version string or number into a single number using bitwise operations. The encoding packs the major version in the high byte and the minor version in the low byte:

    encoded = (major << 8) | minor

    Examples: '1.3' => 0x0103 (259) '77.0' => 0x4d00 (19712)

    Returns

    Bitwise encoded version as a number. Returns 0 if parsing fails.

    Parameters

    • semver: string | number

      Semantic version as a string (e.g., "1.3") or a numeric code.

    Returns number

Generated using TypeDoc