def base58_from_data(data)
      raise ArgumentError, "Data is missing" if !data
      leading_zeroes = 0
      int = 0
      base = 1
      data.bytes.reverse_each do |byte|
        if byte == 0
          leading_zeroes += 1
        else
          leading_zeroes = 0
          int += base*byte
        end
        base *= 256
      end
      return ("1"*leading_zeroes) + base58_from_int(int)
    end
def base58_from_data(data)
      raise ArgumentError, "Data is missing" if !data
      leading_zeroes = 0
      int = 0
      base = 1
      data.bytes.reverse_each do |byte|
        if byte == 0
          leading_zeroes += 1
        else
          leading_zeroes = 0
          int += base*byte
        end
        base *= 256
      end
      return ("1"*leading_zeroes) + base58_from_int(int)
    end
Converts binary string into its Base58 representation.
 If string is empty returns an empty string.
 If string is nil raises ArgumentError