def hash_160_to_address(h160, addrtype=0):
 if ((h160 is None) or (len(h160) is not 20)):
  return None
 vh160 = (chr(addrtype) + h160)
 h = Hash(vh160)
 addr = (vh160 + h[0:4])
 return b58encode(addr)

def hash_160_to_address ( h160 , addrtype = 0 ) : if ( ( h160 is None ) or ( len ( h160 ) is not 20 ) ) : return None vh160 = ( chr ( addrtype ) + h160 ) h = Hash ( vh160 ) addr = ( vh160 + h [ 0 : 4 ] ) return b58encode ( addr )
checks if the provided hash is actually 160bits or 20 bytes long and returns the address .