Closed zelark closed 6 years ago
A goal is generating IDs in lexicographical order. And there are 2 ways to reach for the goal: 1) To do like topic says; 2) Producing numbers in example below in reverse order:
(let [alphabet "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~" time-gen (fn [n] (take n (iterate #(bit-shift-right % 6) (quot (System/currentTimeMillis) 1000)))) time-id (generate alphabet time-gen)] (time-id 6))
A goal is generating IDs in lexicographical order. And there are 2 ways to reach for the goal: 1) To do like topic says; 2) Producing numbers in example below in reverse order: