Permalink
Browse files

md5 > timestamp

  • Loading branch information...
1 parent 5d04fd8 commit 41da678b03bdee3f012758f651bb9fa35a3d61d8 George Buckenham committed Aug 13, 2010
Showing with 6 additions and 3 deletions.
  1. +1 −1 README
  2. +5 −2 generateQR.py
View
2 README
@@ -4,6 +4,6 @@ This is a project to make a QR code you can scan and get a playable little JS ga
Currently everything is within the file generateQR.py . Run this in Python, and if all works, you should see the QR code appear on screen.
-The code within is specified within in the data variable. The image is saved to qr{timestamp}.png, and then displayed with feh.
+The code within is specified within in the data variable. The image is saved to qr{data hash}.png, and then displayed with feh.
Have fun!
View
@@ -1,5 +1,5 @@
from PyQRNative import *
-import time, os
+import time, os, hashlib
qr = QRCode(18, QRErrorCorrectLevel.L)
qr.mode = QRMode.MODE_ALPHA_NUM
@@ -20,7 +20,10 @@
im = qr.makeImage()
-with open("/home/v21/qr" + str(time.time()) + ".png", "wb") as f:
+data_hash = hashlib.md5(data)
+
+
+with open("qr" + data_hash.hexdigest() + ".png", "wb") as f:
im.save(f)

0 comments on commit 41da678

Please sign in to comment.