Type hash support

Define a Hash() function for your opaque data type if the database server cannot use the built-in hashing function to cache its return values.

This category is valid for the C and C++ languages.

Most data types are bit-hashable and can use the built-in hash routine.

Bit-hashable data types have the property that for any hash routine:
if A = B then hash(A) = hash(B)

In practice, this means that A and B have identical bit representations.

There are some data types for which two equal values have different bit representations. For example, in one’s-complement notation, there are two distinct representations for 0 (+0 and -0). The SQL rules for the data type VARCHAR require that trailing blanks be ignored in equality comparisons. Thus, two VARCHAR values with different numbers of trailing blanks will have different bit representations, but they should still be considered equal.

For data types that are not bit-hashable, you must provide a Hash() function.

For the C language, BladeSmith prefixes the names of these functions with the name of the data type for which it is specified: OpaqueHash().