2020-11-24 13:50:56 +00:00
|
|
|
package blobovnicza
|
|
|
|
|
|
|
|
import (
|
2020-11-25 15:55:40 +00:00
|
|
|
"encoding/hex"
|
2020-11-24 13:50:56 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// ID represents Blobovnicza identifier.
|
2020-11-25 15:55:40 +00:00
|
|
|
type ID []byte
|
2020-11-24 13:50:56 +00:00
|
|
|
|
2020-11-25 15:55:40 +00:00
|
|
|
// NewIDFromBytes constructs ID from byte slice.
|
|
|
|
func NewIDFromBytes(v []byte) *ID {
|
|
|
|
return (*ID)(&v)
|
2020-11-24 13:50:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (id ID) String() string {
|
2020-11-25 15:55:40 +00:00
|
|
|
return hex.EncodeToString(id)
|
2020-11-24 13:50:56 +00:00
|
|
|
}
|