keys.gno
0.56 Kb · 19 lines
1// Sorting keys, and nothing else.
2//
3// The clock moved to the ledger, which is what quantises history and so is the
4// only thing that can answer what epoch it is. What is left here is the one
5// encoding decision this realm makes for itself.
6package governor
7
8import (
9 cford32 "gno.land/p/nt/cford32/v0"
10)
11
12// enc is a fixed-width, order-preserving key for a number that has to sort.
13//
14// proposal ids are listed in order, so they cannot be decimal strings: "10"
15// sorts before "9".
16func enc(u uint64) string {
17 b := cford32.PutUint64Lower(u)
18 return string(b[:])
19}