2019-03-18 10:55:06 +00:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
package teststorj
|
|
|
|
|
|
|
|
import (
|
2019-12-27 11:48:47 +00:00
|
|
|
"storj.io/common/storj"
|
2019-03-18 10:55:06 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// PieceIDFromBytes converts a byte slice into a piece ID
|
|
|
|
func PieceIDFromBytes(b []byte) storj.PieceID {
|
|
|
|
id, _ := storj.PieceIDFromBytes(fit(b))
|
|
|
|
return id
|
|
|
|
}
|
|
|
|
|
|
|
|
// PieceIDFromString decodes a hex encoded piece ID string
|
|
|
|
func PieceIDFromString(s string) storj.PieceID {
|
|
|
|
return PieceIDFromBytes([]byte(s))
|
|
|
|
}
|