Giter Club home page Giter Club logo

Comments (2)

JordanReiter avatar JordanReiter commented on August 25, 2024 1

md5 is only deprecated for security purposes. It's perfectly fine to use md5 from hashlib for creating a unique hash.

In this case, however, I'm really not sure why the cache key is being created in this way at all. You may as well just use the actual hostname instead, since it's already a string to begin with and there is (at worst) a one-to-one correspondence between a hostname and its hashed version.

But just to be clear: the reason md5 is deprecated in Django is because it exists as a built-in in later versions of Python, not because there's anything wrong per-se with md5. Yes, md5 should no longer be used for security purposes, but as a very fast hashing function it's definitely better than Python's built-in hash. Python's hash function is not intended to create reliably unique pointers to values. The hash is just an 8 byte integer; an md5 hash is 16 bytes. So md5 has half the number of potential collisions.

from django-multisite.

rebkwok avatar rebkwok commented on August 25, 2024

Closing for the reasons outlined by @JordanReiter above

from django-multisite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.