This commit is contained in:
Colin Davis 2011-07-05 17:27:40 -04:00
parent 8ac947a94a
commit ee805ff642
4 changed files with 22 additions and 1 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 16 KiB

21
tests/md5bits.py Normal file
View File

@ -0,0 +1,21 @@
import hashlib
import pprint
numblocks = 5
blockcount = 10
hash = hashlib.sha512()
hash.update("This is my not-yethashed text")
hexdigest = hash.hexdigest()
hashes = []
for i in range(0,numblocks):
#Get 1/numblocks of the hash
blocksize = (len(hexdigest) / numblocks)
currentstart = (1 + i) * blocksize - blocksize
currentend = (1 +i) * blocksize
hashes.append(int(hash.hexdigest()[currentstart:currentend],16))
pprint.pprint(hashes)
for h in hashes:
print h % 10

View File

@ -51,7 +51,7 @@ class MainHandler(tornado.web.RequestHandler):
for png in hashlist:
img = Image.open(png)
robohash.paste(img,(0,0),img)
robohash.save("/opt/robohash/static/images/out.png")
robohash.save("static/images/out.png")
self.write("Running in Random mode:<br>")
self.write("<img src='/images/out.png'>")