type ballot struct {
    epoch uint32
    replicId uint8
    number uint64
}

// getters and setters

func (b *ballot) toUint64() uint64 {
    // do some bit operations based on epoch, replicaId and number
}