Quantcast
Viewing all articles
Browse latest Browse all 25

Answer by Mr Public for Tweetable hash function challenge

Python, 9310


Yeah, not the best, but at least it is something. As we say in crypto, never write your own hash function.

This is exactly 140 bytes long, as well.

F=lambda x,o=ord,m=map:int((int(''.join(m(lambda z:str(o(z)^o(x[-x.find(z)])^o(x[o(z)%len(x)])),x)))^(sum(m(int,m(o,x))))^o(x[-1]))%(2**24))

Viewing all articles
Browse latest Browse all 25

Trending Articles