BytesToTruncatedString() converts a byte slice to a truncated hexadecimal string
(b []byte)
| 554 | |
| 555 | // BytesToTruncatedString() converts a byte slice to a truncated hexadecimal string |
| 556 | func BytesToTruncatedString(b []byte) string { |
| 557 | // if the bytes are LTE the truncation |
| 558 | if len(b) <= 10 { |
| 559 | // simply return the string version |
| 560 | return hex.EncodeToString(b) |
| 561 | } |
| 562 | // return the truncated string version |
| 563 | return hex.EncodeToString(b[:10]) |
| 564 | } |
| 565 | |
| 566 | // PublicKeyFromBytes() converts a byte slice into a BLS public key |
| 567 | func PublicKeyFromBytes(pubKey []byte) (crypto.PublicKeyI, ErrorI) { |
no outgoing calls