080ba47a06
Change-Id: I6a419c62700c568254ff67ae5b73efed2fc98aa2
20 lines
445 B
Go
20 lines
445 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))
|
|
}
|