shorten name (#1649)

This commit is contained in:
Preston Van Loon 2019-02-19 16:38:29 -05:00 committed by terence tsao
parent 2425bef5c7
commit 4ee57f1c45

View File

@ -49,10 +49,10 @@ func ensureInt(x interface{}) int {
}
// keyFileName implements the naming convention for keyfiles:
// UTC--<created_at UTC ISO8601>-<address hex>
// UTC--<created_at UTC ISO8601>-<first 8 character of address hex>
func keyFileName(pubkey *bls.PublicKey) string {
ts := time.Now().UTC()
return fmt.Sprintf("UTC--%s--%s", toISO8601(ts), hex.EncodeToString(pubkey.Marshal()))
return fmt.Sprintf("UTC--%s--%s", toISO8601(ts), hex.EncodeToString(pubkey.Marshal())[:8])
}
func toISO8601(t time.Time) string {