def stringToLong(s):
 result = 0L
 for byte in s:
  result = ((256 * result) + ord(byte))
 return result

def stringToLong ( s ) : result = 0 L for byte in s : result = ( ( 256 * result ) + ord ( byte ) ) return result
convert digest to long .