Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6896893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:06:03+00:00 2026-05-27T07:06:03+00:00

For example commit list on GitHub shows only first 10, or this line from

  • 0

For example commit list on GitHub shows only first 10, or this line from tornadoweb which uses only 5

return static_url_prefix + path + "?v=" + hashes[abs_path][:5]

Are only the first 5 chars enough to make sure that 2 different hashes for 2 different files won’t collide?

LE: The example above from tornadoweb uses md5 hash for generating a query sting for static file caching.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:06:04+00:00Added an answer on May 27, 2026 at 7:06 am

    In general, No.

    In fact, even if a full MD5 hash were given, it wouldn’t be enough to prevent malicious users from generating collisions—MD5 is broken. Even with a better hash function, five characters is not enough.

    But sometimes you can get away with it.

    I’m not sure exactly what the context of the specific example you provided is. However, to answer your more general question, if there aren’t bad guys actively trying to cause collisions, than using part of the hash is probably okay. In particular, given 5 hex characters (20 bits), you won’t expect collisions before around 2^(20/2) = 2^10 ~ one thousand values are hashed. This is a consequence of the the Birthday paradox.

    The previous paragraph assumes the hash function is essentially random. This is not an assumption anyone trying to make a cryptographically secure system should make. But as long as no one is intentionally trying to create collisions, it’s a reasonable heuristic.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's an example: >git status # On branch master nothing to commit (working directory
Example: select ename from emp where hiredate = todate('01/05/81','dd/mm/yy') and select ename from emp
Example: The user login to the webpage => Click on a button This action
Is there a more complicated example of knockout.js along the lines of Holla https://github.com/maccman/holla/commits/master/app
I tried an example from NHibernate in Action book and when I try to
I have a list of params with names and values like this: date_2009-09-16 =>
How could I let SVN list all files which were ever committed to a
hello i'm a beginner java developer and this is one question in a list
I'm trying to set up a simple association in NHibernate (this is the first
I am writing an automated system to list commits between two commit references. Say

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.