Files
Adrian Hamelink 0c6c752b43 round:
- add ability to broadcast
- remove protocol.ID type in favor of simple string
- cleanup helper.Send
- move types.RoundNumber to round
- Add round.Message type
- change Round interface.. again
- add testing function for round
2021-08-19 17:40:35 +02:00

22 lines
445 B
Go

package round
import (
"encoding/binary"
"io"
)
// Number is the index of the current round.
// 0 indicates the output round, 1 is the first round.
type Number uint16
// WriteTo implements io.WriterTo interface.
func (i Number) WriteTo(w io.Writer) (int64, error) {
err := binary.Write(w, binary.BigEndian, uint64(i))
return 2, err
}
// Domain implements hash.WriterToWithDomain.
func (Number) Domain() string {
return "Round Number"
}