cmd/hakurei: short identifier from lower half

The upper half is now a nanosecond timestamp. Lower half is still random bytes, so use lower half for short identifier.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-10-24 00:47:39 +09:00
parent 2442eda8d9
commit 7de593e816
5 changed files with 195 additions and 36 deletions

View File

@@ -215,7 +215,7 @@ func printPs(output io.Writer, now time.Time, s state.Store, short, flagJSON boo
encodeJSON(log.Fatal, output, short, v)
} else {
for _, e := range exp {
mustPrintln(output, e.s[:8])
mustPrintln(output, shortIdentifierString(e.s))
}
}
return
@@ -237,12 +237,12 @@ func printPs(output io.Writer, now time.Time, s state.Store, short, flagJSON boo
as = strconv.Itoa(e.Config.Identity)
id := e.Config.ID
if id == "" {
id = "app.hakurei." + e.s[:8]
id = "app.hakurei." + shortIdentifierString(e.s)
}
as += " (" + id + ")"
}
t.Printf("\t%s\t%d\t%s\t%s\n",
e.s[:8], e.PID, as, now.Sub(e.Time).Round(time.Second).String())
shortIdentifierString(e.s), e.PID, as, now.Sub(e.Time).Round(time.Second).String())
}
}