fork download
  1. # your code goes here
  2. def mycoolhash(data,length=32,itr=128,salt=0x1234567890ABCDEF):
  3. result = 0xBA5E0FDA7AB17C01
  4. data = str(data)
  5. for i in range(itr):
  6. for char in data: result = int(str(result)[::-1])^(ord(char)|(ord(char)<<16))
  7. result = (int(str(result*salt)[::-1])<<i)%int(length*'F',16)
  8. return result
  9. a = mycoolhash("@U.",itr=32)
  10. b = mycoolhash("BU,",itr=32)
  11. print(hex(a),hex(b),a==b)
Success #stdin #stdout 0.02s 9556KB
stdin
Standard input is empty
stdout
0x14ac66645dbc39a2f850e89d20011bb1 0x14ac66645dbc39a2f850e89d20011bb1 True