2023-09-19 15:08:38 +00:00
|
|
|
package blobovniczatree
|
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
|
|
|
|
2022-04-21 11:28:05 +00:00
|
|
|
// NewIDFromBytes constructs an ID from a byte slice.
|
2020-11-25 15:55:40 +00:00
|
|
|
func NewIDFromBytes(v []byte) *ID {
|
|
|
|
return (*ID)(&v)
|
2020-11-24 13:50:56 +00:00
|
|
|
}
|
|
|
|
|
2023-09-19 15:08:38 +00:00
|
|
|
func (id ID) Path() string {
|
|
|
|
return string(id) + dbExtension
|
2020-11-24 13:50:56 +00:00
|
|
|
}
|
2022-07-06 14:09:50 +00:00
|
|
|
|
|
|
|
func (id ID) Bytes() []byte {
|
|
|
|
return id
|
|
|
|
}
|