Skip to content

Instantly share code, notes, and snippets.

@berlotto
Last active August 29, 2015 13:57
Show Gist options
  • Save berlotto/9647928 to your computer and use it in GitHub Desktop.
Save berlotto/9647928 to your computer and use it in GitHub Desktop.
A Python server side implementation for jQuery Real Person Plugin
import numpy as np
#------------------------------
def rpHash(person):
hash = 5381
value = person.upper()
for caracter in value:
hash = (( np.left_shift(hash, 5) + hash) + ord(caracter))
hash = np.int32(hash)
return hash
#-----------------------------
if rpHash(request.form['realPerson']) == request.form['realPersonHash']:
print "Your are a real person!"
else:
print "You are a bot!"
@kbwood
Copy link

kbwood commented Mar 20, 2014

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment