lexicographic_int library

Lexicographically sortable encoding of integer numbers.

Constants

defaultMinusCharacter → const String
'-'
defaultPlusCharacter → const String
'^'

Functions

decode(String encInteger, {String minusCharacter: defaultMinusCharacter, String plusCharacter: defaultPlusCharacter}) → String
Decodes a lexicographically sortable number to an integer string.
encode(String intString, {String minusCharacter: defaultMinusCharacter, String plusCharacter: defaultPlusCharacter, bool borrowNegative: false}) → String
Encodes the intString to a lexicographically sortable string Instead of '+', the '^' character is used, because ASCII codes. intString should be in RegExp('+-?\d+') format, ex. -15, +12, 764