FixIO Documentation
Back to summary
Global functions
Serialization
function serialize_key(value): Byte[]
function serialize_key(buf: Byte[], value)
-
Serializes given value in a manner compatible with comparisons in serialized
form. This is the same as ordinary serialization except that references are
duplicated and the hash tables are sorted by key. This provides a canonical
form suitable for keys. Optionally the serialized value can be appended into
an existing array.
function serialize_compare(buf1: Byte[], buf2: Byte[]): Integer
function serialize_compare(buf1: Byte[], off1: Integer, len1: Integer, buf2: Byte[], off2: Integer, len2: Integer): Integer
-
Compares values directly in their serialized form. It is preferred that the
serialize_key
function is used for serialization to provide consistent
sorting of hash keys and avoiding an error when encountering references as they are
not supported when comparing. The comparison occurs between the same type only,
different types are compared in this order: integers, floats, arrays, strings, hash tables
(from smaller to bigger). The result is less than zero if the first value is smaller,
greater than zero if the first value is bigger or zero if the values are the same.