how to apply concurrency for iterating over full uint64 (18446744073709551615) range : For purely educational purposes, I created a [base58][1] package basically it encode/decode an uint64 using the [bitcoin base58 symbol chart][2], for example:

    b58 := Encode(100)  // return 2j

    num := Decode("2j") // return 100

While creating the first tests I came with [this][3]:

    func TestEncode(t *testing.T) {
    	var i uint64
    	for i = 0; i <= (1<<64 - 1); i++ {
    		b58 := Encode(i)
    		num := Decode(b58)
    		if num != i {
    			t.Fatalf("Expecting %d for %s", i, b58)
    		}
    	}
    }

This "naive" implementation, tries to convert all the range from uint64 (From 0 to 18,446,744,073,709,551,615) to base58 and later back to uint64 but takes to much time.

To better understand how [go][4] handles concurrency I would like to know how to use channels or [goroutines][5] and perform the iteration across the full uint64 range in the most efficient way?

Could data be processed by chunks and in parallel, if yes how to accomplish this?

Thanks in advance.



  [1]: https://github.com/nbari/base58
  [2]: https://en.bitcoin.it/wiki/Base58Check_encoding
  [3]: https://github.com/nbari/base58/blob/master/base58_test.go
  [4]: https://golang.org/
  [5]: https://tour.golang.org/concurrency/1