forked from TrueCloudLab/frostfs-api-go
[#168] refs: Implement binary/JSON encoders/decoders on Address
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
9325e22871
commit
4ce751f13c
7 changed files with 114 additions and 33 deletions
|
@ -20,6 +20,13 @@ func randID(t *testing.T) *ID {
|
|||
return id
|
||||
}
|
||||
|
||||
func randCID(t *testing.T) *container.ID {
|
||||
id := container.NewID()
|
||||
id.SetSHA256(randSHA256Checksum(t))
|
||||
|
||||
return id
|
||||
}
|
||||
|
||||
func randSHA256Checksum(t *testing.T) (cs [sha256.Size]byte) {
|
||||
_, err := rand.Read(cs[:])
|
||||
require.NoError(t, err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue