Text operations that must give the same result on every platform.
The JVM and JavaScript compare strings by UTF-16 code unit, but .NET's default string comparison follows the current culture, which orders case differently and can ignore hyphens. Everything that sorts or compares strings for output (canonical JSON key order, the signature digest list, timestamps) goes through compare-strings, so every platform produces the same bytes. Numbers are formatted without culture for the same reason.
Text operations that must give the same result on every platform. The JVM and JavaScript compare strings by UTF-16 code unit, but .NET's default string comparison follows the current culture, which orders case differently and can ignore hyphens. Everything that sorts or compares strings for output (canonical JSON key order, the signature digest list, timestamps) goes through compare-strings, so every platform produces the same bytes. Numbers are formatted without culture for the same reason.
(code-unit s i)The UTF-16 code unit at index i of s, as an integer.
The UTF-16 code unit at index i of s, as an integer.
(compare-strings a b)Compares two strings by UTF-16 code unit, on every platform.
Compares two strings by UTF-16 code unit, on every platform.
(hex n)A non-negative integer in uppercase hexadecimal.
A non-negative integer in uppercase hexadecimal.
(number->string x)A number as JSON writes it, independent of culture.
A number as JSON writes it, independent of culture.
(sort-strings xs)Strings sorted by UTF-16 code unit, on every platform.
Strings sorted by UTF-16 code unit, on every platform.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |