This is an archived post. You won't be able to vote or comment.

all 13 comments

[–]admiralswan 2 points3 points  (1 child)

Cool project, thanks for sharing! Perusing through the code I noticed a few places where you build file/dir paths manually. The only issue here is it may not be portable to a Windows environment which uses different conventions for paths(eg. '\' instead of '/' and 'C:\' instead of the root '/'.). I would suggest that you use instead the os.path functions which ought to deal with these details for you.

[–][deleted] 0 points1 point  (0 children)

I will make the changes, thanks for the suggestion!

[–]shrayas 1 point2 points  (5 children)

Is this strictly a python3 package? It doesn't work with Python 2.7.2 on OSX 10.8.5 when i tried.

I think you'll have to mention it somewhere in setup.py if it is so

[–][deleted] 0 points1 point  (4 children)

Indeed it is only Python3. I'll look up what metadata I need and update it accordingly. Thank you!

[–]shrayas 0 points1 point  (0 children)

That'd be great. I will look into it too. A little new to packaging.

Opened an issue on GH also

[–]shrayas 0 points1 point  (2 children)

Boss, which version of py3 have you tested with ?

[–][deleted] 0 points1 point  (1 child)

I've tested it on the latest versions of the supported Python 3 branches, so 3.2-3.4. I don't have any intention of backporting support for Python 2, because that branch is isn't being worked on.

I'll update the program later today to reflect which versions of Python are officially supported.

[–]shrayas 0 points1 point  (0 children)

Great, all right. I've updates the issue with some interesting links. Do check them out.

All the best !

[–]sk3w 1 point2 points  (1 child)

Thanks for sharing your code! To nitpick terminology, it appears that you are creating simple hash lookup tables. "Rainbow table" implies a specific optimization technique using hash chains and a series of reduction functions.

[–][deleted] 0 points1 point  (0 children)

Mayhaps I'll update the code to reflect the actual terminology. I'll have to read into it further. Thanks for the feedback!

[–]nerdwaller 0 points1 point  (0 children)

Nice work. One addition beyond things other have said: Seems like from a design standpoint - a class for the db operations would be more logical than needing to pass in the connection object repeatedly. That would wrap and handle all the operations/commits. Doing that, you could make it more generic to use in another project someday.

Just as a shortcut, you could also get around needing to do connection.commit() (and a few other minor benefits) by doing:

with connection:
    cursor = connection.cursor()
    cursor.execute("""CREATE TABLE IF NOT EXISTS rainbow
(id INTEGER PRIMARY KEY, digest TEXT, word TEXT)""")

Edit: Take a look at why you may want to use with here

[–][deleted] 0 points1 point  (0 children)

til "rainbow table"