Hi,
I have just started python as after a chat with a friend I have discovered it would be the most suitable language for my latest project. The problem I have come across is I need a sha1 function written in python. I don't want to use the built in hashlib but I need an open source algorithm that I can modify. Can anybody help me on this one as google shows me nothing in the way of code snippets. Also I tried recreating the algorithm from scratch but turned out terribly hard to convert c++ code to python.
Thanks.

Recommended Answers

All 4 Replies

You could try to convert the C code from the files shamodule.c, sha256module.c and sha512module.c in the python source distribution, which provide the sha algorithms for the hashlib module.

You can actually bind C and C++ libraries to python, that way you wouldn't need to re-write the code, and would still get the efficiency of the original library.

Well I need to be able to make constant changes to the library without having to recompile the library. Nice idea but not for this situation.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.