3.1.1.2.5.2 8-Bit String Comparison

When making comparisons of 8-bit character string values, the NSPI server MUST compare according to the following series of steps:

  1. If the strings are categorized as case-sensitive, the NSPI server MUST implement a case-sensitive buffer comparison. If the strings are case-insensitive, the NSPI server MUST implement a case-insensitive buffer comparison. The NSPI Protocol does not constrain how a server implements these comparison functions. However, because the protocol intends for clients to be able to persist sorted string values across multiple NSPI connections to an NSPI server, a server MUST NOT modify its algorithm for either of these buffer comparison functions, because doing so would lead to inconsistent behavior of NSPI methods across multiple NSPI sessions.

  2. If the buffer representing one of the string values is shorter than the buffer representing the other string value, then the NSPI server considers the string value represented by the shorter buffer to be less than the string represented by the longer buffer.  No further comparison steps are taken.

  3. If the buffers representing the two string values have equal lengths, the comparison function implemented by the server MUST determine that one buffer is less than the other, or that the buffers are equal.

  4. If the comparison function determines that one of the buffers is less than the other, then the NSPI server considers the string value represented by the lesser buffer to be less than the string value represented by the greater buffer.  No further comparison steps are taken.

  5. If the comparison function determines that the two buffers are equal, then the NSPI server considers the two string values to be equal.