 PRIVATE>
 
 : ulid ( -- ulid )
-    same-msec? (ulid) ;
+    same-millisecond? (ulid) ;
 
 ERROR: ulid>bytes-bad-length n ;
 M: ulid>bytes-bad-length summary drop "Invalid ULID length" ;

: encode-time ( timestamp -- string )
    timestamp>millis 10 encode-bits ;

: same-msec? ( -- ? )
    nano-count 1000 /i dup \ same-msec? get =
    [ drop t ] [ \ same-msec? set f ] if ;

: pack-bits ( seq -- seq' )
    5 swap [ first ] [ rest ] bi [


TR: (normalize-ulid) "ILO" "110" ; inline

: (ulid) ( same-millisecond? -- ulid )
    [
        last-time-string get last-random-bits get 1 +
        dup 80-bits > [ ulid-overflow ] when
