storj/private/teststorj/pieceid.go
Egon Elbre 6615ecc9b6 common: separate repository
Change-Id: Ibb89c42060450e3839481a7e495bbe3ad940610a
2019-12-27 14:11:15 +02:00

20 lines
443 B
Go

// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
package teststorj
import (
"storj.io/common/storj"
)
// 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))
}