You are reading content from Scuttlebutt
@aljoscha %cqSExpmrBcq+Rf1a5rRGuZ2kcoaMTw2ZN8u2DM2l2FY=.sha256
Re: %ZOosXgUtS

Updated the spec (and the rust implementation):

  • The order in which to serialize the entries s_i: v_i is not fully specified, but there are some constraints:
    • intuitively: Natural numbers less than 2^32 - 1 are sorted ascendingly
    • formally:
      • a key is called a more-or-less integer key if it is either the string "0", or a nonzero decimal digit (1 - 9 (0x31 - 0x39)) followed by zero or more arbitrary decimal digits (0 - 9 (0x30 - 0x39)) and consists solely of such digits
      • a key is called an int key if it:
        • is a more-or-less integer key
        • its numeric value is strictly less than 2^32 - 1
          • no, there's no off-by one error here: 0xfffffffe is an int key, whereas 0xffffffff is not
          • Why? We have no idea either
      • all entries with int keys must be serialized before all other entries
      • among themselves, the int keys are sorted:
        • by length first (ascending), using
        • numeric value as a tie breaker (the key whose raw bytes interpreted as a natural number are larger is serialized later)
          • note that this coincides with sorting the decimally encoded numbers by numeric value
    • all other entries may be serialized in an arbitrary order
Join Scuttlebutt now