Comments (7)
from axelbib.
This post closes the issue: http://stackoverflow.com/questions/7646520/is-this-an-appropriate-use-of-pythons-built-in-hash-function
from axelbib.
from axelbib.
Also that post is just one opinion. When a reviewer or examiner says 'why did you do that?', 'stackoverflow' won't be a good answer.
from axelbib.
-
hash()
built in function returns the hash value of the object (if it has one) of 64-bit. The 64-bit It is mainly used to quickly compare dictionary keys during a dictionary lookup.Hash()
is randomised by default each time you start a new instance. -
hashlib
has 2 sets of functions:- MD5: Message digest algorithm producing a 128 bit hash value. This is widely used to check data integrity. It is not suitable for use in other fields due to the security vulnerabilities of MD5.
- SHA: Group of algorithms designed by the U.S's NSA that are part of the U.S Federal Information processing standard. These algorithms are used widely in several cryptographic applications. The message length ranges from 160 bits to 512 bits.
Because we are not doing cryptography and 128 bit should be enough to avoid collusion for our data base, MD5 should be appropriate for us to use. Also I have checked that it returns same hash.
from axelbib.
from axelbib.
I will be using hashlib.md5()
because it seems more appropriate for hashing and a collusion is more unlikely to happen.
from axelbib.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from axelbib.