frostfs-sdk-go/subnet/id/test/id.go
Leonard Lyubich b8989e3abb [#79] Implement type for subnet ID
Create `subnet` package. Define `ID` type of subnet identifiers.
Implement encoding and support NeoFS API V2 protocol. Provide method to
init instance from integer. Implement function which checks if `ID`
instance refers to zero subnet.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-11-25 13:04:24 +03:00

16 lines
281 B
Go

package subnetidtest
import (
"math/rand"
subnetid "github.com/nspcc-dev/neofs-sdk-go/subnet/id"
)
// GenerateID generates and returns random subnetid.ID using math/rand.Uint32.
func GenerateID() *subnetid.ID {
var id subnetid.ID
id.SetNumber(rand.Uint32())
return &id
}