decode base58 string to hex value.
421699
def decode(base58_val)
      int_val = 0
      base58_val.reverse.split(//).each_with_index do |char,index|
        raise ArgumentError, 'Value passed not a valid Base58 String.' if (char_index = ALPHABET.index(char)).nil?
        int_val += char_index * (SIZE ** index)
      end
      s = int_val.to_even_length_hex
      s = '' if s == '00'
      leading_zero_bytes = (base58_val.match(/^([1]+)/) ? $1 : '').size
      s = ('00' * leading_zero_bytes) + s if leading_zero_bytes > 0
      s
    end
106520
def hexdigest(self, data=None):
        
        from base64 import b16encode
        if pyver == 2:
            return b16encode(self.digest(data))
        else:
            return b16encode(self.digest(data)).decode('us-ascii')
1094930
def pp_hex(raw, reverse=True):
    
    if not reverse:
        return ''.join(['{:02x}'.format(v) for v in bytearray(raw)])
    return ''.join(reversed(['{:02x}'.format(v) for v in bytearray(raw)]))
958349
private static void convertHexToUnicode(String str) {
        try {
            display("Hex to Unicode: " + Utils.toString(Utils.base64ToBinary(Utils.base64FromHex(str))));
        } catch (Exception e) {
        }
    }
241600
def a2b_hashed_base58(s):
    
    data = a2b_base58(s)
    data, the_hash = data[:-4], data[-4:]
    if double_sha256(data)[:4] == the_hash:
        return data
    raise EncodingError("hashed base58 has bad checksum %s" % s)
188706
function fromUtf8(stringValue) {
  const str = new Buffer(stringValue, 'utf8');

  return `0x${padToEven(str.toString('hex')).replace(/^0+|0+$/g, '')}`;
}
1046570
def b58decode_int(v):
    ''''''
    v = v.rstrip()
    v = scrub_input(v)

    decimal = 0
    for char in v:
        decimal = decimal * 58 + alphabet.index(char)
    return decimal
292329
def base64_bytes(x):
    """"""
    if six.PY2:
        return base64.decodestring(x)
    return base64.decodebytes(bytes_encode(x))
1138396
public function encodeBase58($hex)
    {
        $this->preOpMethodParamsCheck(array($hex));

        try {

            if (strlen($hex) % 2 != 0 || $this->Test($hex) != 'hex') {
                throw new \Exception('Uneven number of hex characters or invalid parameter passed to encodeBase58 function.  Value received was "' . var_export($hex, true) . '".');
            } else {
                $orighex = $hex;
                $hex     = $this->addHexPrefix($this->prepAndClean($hex));
                $return  = strrev($this->encodeValue($hex, '58'));

                for ($i = 0; $i < strlen($orighex) && substr($orighex, $i, 2) == '00'; $i += 2) {
                    $return = '1' . $return;
                }
            }

            return $return;

        } catch (\Exception $e) {
            throw $e;
        }
    }
552588
def b58decode(v):
    ''''''
    v = v.rstrip()
    v = scrub_input(v)

    origlen = len(v)
    v = v.lstrip(alphabet[0:1])
    newlen = len(v)

    acc = b58decode_int(v)

    result = []
    while acc > 0:
        acc, mod = divmod(acc, 256)
        result.append(mod)

    return (b'\0' * (origlen - newlen) + bseq(reversed(result)))
899076
function decode(base32String) {
	// Decode to Buffer
	var bytes = base32.parse(base32String, {
		out: Buffer.alloc,
		loose: true
	});

	return bytes.toString("hex");
}
334209
def b2a_base58(s):
    """"""
    v, prefix = to_long(256, lambda x: x, iterbytes(s))
    s = from_long(v, prefix, BASE58_BASE, lambda v: BASE58_ALPHABET[v])
    return s.decode("utf8")
786284
def decode_base58_address(addr)
      hex = Base58.decode(addr)
      if hex.size == 50 && calc_checksum(hex[0...-8]) == hex[-8..-1]
        raise 'Invalid version bytes.' unless [Bitcoin.chain_params.address_version, Bitcoin.chain_params.p2sh_version].include?(hex[0..1])
        [hex[2...-8], hex[0..1]]
      else
        raise 'Invalid address.'
      end
    end
1254205
function tryParseBase64ToBytes(b64Str) {
    let decodedStr;

    try {
      decodedStr = atob(b64Str);
    } catch (e) {
      return null;
    }

    return Uint8Array.from(decodedStr, c => c.charCodeAt(0));
  }
220766
def a2b_base58(s):
    """"""
    v, prefix = to_long(BASE58_BASE, lambda c: BASE58_LOOKUP[c], s.encode("utf8"))
    return from_long(v, prefix, 256, lambda x: x)
1223334
def hex_decode(encoded)
      encoded.scan(/[[:xdigit:]]{2}/).map { |h| h.hex.chr }.join
    end
1056033
def decode(s, checksum=True):
    """"""
    v, prefix = to_long(
        BASE58_BASE, lambda c: BASE58_LOOKUP[c], s.encode("utf8"))

    data = from_long(v, prefix, 256, lambda x: x)

    if checksum:
        data, the_hash = data[:-4], data[-4:]
        if utils.hash256(data)[:4] == the_hash:
            return data
        raise ValueError("hashed base58 has bad checksum %s" % s)

    return data