code: func (enc *Encoding) Encode(src []byte) ([]byte, error) {
  	if len(src) == 0 {
  		return []byte{}, nil
  	}
  	n, ok := new(big.Int).SetString(string(src), 10)
  	if !ok {
  		return nil, fmt.Errorf("expecting a number but got %q", src)
  	}
  	bytes := make([]byte, 0, len(src))
  	for _, c := range src {
  		if c == '0' {
  			bytes = append(bytes, enc.alphabet[0])
  		} else {
  			break
  		}
  	}
  	zerocnt := len(bytes)
  	mod := new(big.Int)
  	zero := big.NewInt(0)
  	for {
  		switch n.Cmp(zero) {
  		case 1:
  			n.DivMod(n, radix, mod)
  			bytes = append(bytes, enc.alphabet[mod.Int64()])
  		case 0:
  			reverse(bytes[zerocnt:])
  			return bytes, nil
  		default:
  			return nil, fmt.Errorf("expecting a non-negative number in base58 encoding but got %s", n)
  		}
  	}
  }
docs: // Encode encodes the number represented in the byte array base 10.