frostfs-node/pkg/local_object_storage/blobovnicza/id.go
Leonard Lyubich 3028718691 [#211] blobovnicza: Refactor ID implementation
Replace UUID implementation of ID with byte slice.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-12-11 17:19:37 +03:00

17 lines
276 B
Go

package blobovnicza
import (
"encoding/hex"
)
// ID represents Blobovnicza identifier.
type ID []byte
// NewIDFromBytes constructs ID from byte slice.
func NewIDFromBytes(v []byte) *ID {
return (*ID)(&v)
}
func (id ID) String() string {
return hex.EncodeToString(id)
}