Exemple #1
0
func GenerateId() string {
	b := make([]byte, 16)
	if _, err := rand.Read(b); err != nil {
		return ""
	}
	return utils.Fingerprint(b).ToShortName()
}
Exemple #2
0
func KeyFingerprint(key key.PublicKey) utils.Fingerprint {
	bytes := sha256.Sum256(key.Marshal())
	return utils.Fingerprint(bytes[:])
}