diff --git a/static/images/out.png b/static/images/out.png index 519031e..f0ebe32 100644 Binary files a/static/images/out.png and b/static/images/out.png differ diff --git a/generate-roboto.py b/tests/generate-roboto.py similarity index 100% rename from generate-roboto.py rename to tests/generate-roboto.py diff --git a/tests/md5bits.py b/tests/md5bits.py new file mode 100644 index 0000000..672d269 --- /dev/null +++ b/tests/md5bits.py @@ -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 diff --git a/webfront.py b/webfront.py index b46a258..e3bc393 100755 --- a/webfront.py +++ b/webfront.py @@ -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:
") self.write("")