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 6134733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:23:33+00:00 2026-05-23T17:23:33+00:00

we use md5 as a hashing algorithm in many parts of our code. security

  • 0

we use md5 as a hashing algorithm in many parts of our code.

security in this context is NOT an issue. we just use md5 as a method of generating a unique identifier to store various items in apc etc.

collisions are an issue. although unlikely, it would cause some major issues.

anyone want to suggest something lighter on the cpu?

thanks.


we have just done some testing with md5 vs crc32.

using the following snippet:

<?
$start=microtime(true);
for($i=1;$i<=1000000;$i++){
    md5(rand(10000000,99999999)); <--- crc32 tested here too.
}
$end=microtime(true);
echo $end-$start."\n";
?>

there results are as follow:

md5:

1.4991459846497
1.7893800735474
1.4672470092773

crc32:

0.97880411148071
0.94331979751587
0.93316197395325

so it would appear crc32 is about 1/3 faster then using md5.

  • 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-23T17:23:34+00:00Added an answer on May 23, 2026 at 5:23 pm

    It would be very hard (almost impossible, really) to beat CRC32 or a variant as it is so trivial (a rolling XOR across a single 32-bit word). Furthermore, since crc32 cheats and jumps to native code, unless the other solution does that as well, chances are the native CRC32 implementation won’t be beaten.

    However, it also has a much smaller space than MD5. Is the trade-off okay? CRC32’s are usually only for basic error detection/framing… (It really is a “checksum” and not a “hashing” function for practical conversation purposes.)

    Happy coding.


    Also your numbers only show a 2/3 reduction 😉 In any case, I suspect this is not the main bottleneck and would highly recommend using an algorithm that will work — be it MD5 or SHA1 or other. MD5 is only slightly computationally less expensive than SHA1 (it’s within an order of magnitude), but it is possible that the implementation plays a factor. Run benchmarks on this as well if desired…

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

Sidebar

Related Questions

I have used unsalted md5/sha1 for long time, but as this method isn't really
I am looking to use Java to get the MD5 checksum of a file.
The .NET framework ships with 6 different hashing algorithms: MD5: 16 bytes (Time to
re question non-random-salt-for-password-hashes Mr Potato Head states that the use of md5 instead of
This Wikipedia page has an extensive list of hashing methods As you can see,
I'm trying to generate the MD5 Fingerprint I will use with the release of
I want to use a temp directory that will be unique to this build.
First off: I know that AES is a block cipher and not a hashing
I'm trying to find a good (and well documented) hashing library to use with
I tried to use MD5 encryption for the iPhone app I'm creating. I created

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.