def str2long(s):
if type(s) not in (types.StringType, types.UnicodeType):<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>l = <NUM_LIT:0><EOL>for i in s:<EOL><INDENT>l <<= <NUM_LIT:8><EOL>l |= ord(i)<EOL><DEDENT>return l<EOL>
Convert a string to a long integer.