[Request] I need a faster MD5 hash calculator (must beat 23 seconds for a 5GB file)

Jayro

MediCat USB Dev
OP
Developer
Joined
Jul 23, 2012
Messages
13,009
Trophies
4
Location
WA State
Website
ko-fi.com
XP
17,113
Country
United States
I've currently switched from IgorWare Hasher to RapidCRC Unicode, and the speed difference is night and day; RapidCRC Unicode can calculate an MD5 hash in 23 seconds for a 5GB ISO file:

rapidcrcunicode.png





So far, I've found FastSum comes close in second place at 28 seconds for the same file:

fastsum.png




But are there even faster MD5 hasher apps available? (Maybe some with GPU acceleration?)

All tests are done from an 8GB 2,200 MB/s DDR3 RAMdisk, so disk i/o shouldn't be a bottleneck.
 

Monado_III

Well-Known Member
Member
Joined
Feb 8, 2015
Messages
722
Trophies
0
Location
/dev/null
XP
1,443
Country
Canada
I can get 15-17 seconds on a 6,780,092,416 byte file consistently using md5sum and my program below on linux, does it have to be a gui?
Code:
gcc -lssl -lcrypto -O3 -Wall -o file file.c
Code:
#include <stdio.h>
#include <openssl/md5.h>

int main(int argc, char **argv)
{
   unsigned char c[MD5_DIGEST_LENGTH];
   if(argc == 1)
       return 0;
   char *filename=argv[1];
   unsigned int i;
   FILE *inFile = fopen (filename, "rb");
   MD5_CTX mdContext;
   unsigned int bytes;
   unsigned char data[1024];
   if (inFile == NULL)
       return 0;
   MD5_Init (&mdContext);
   while ((bytes = fread (data, 1, 1024, inFile)) != 0)
      MD5_Update (&mdContext, data, bytes);

   MD5_Final (c,&mdContext);
   for(i = 0; i < MD5_DIGEST_LENGTH; i++)
      printf("%02x", c[i]);
   printf (" %s\n", filename);
   fclose (inFile);
   return 0;
}

I got it from here, I made some minor adjustments to make it faster (-O3) and let the user specify the file

Code:
$ time md5sum SX4E01.wbfs && time ./file_gcc SX4E01.wbfs && time ./file_clang SX4E01.wbfs
6c7939e99feba22f06d2f55d3f45d09d  SX4E01.wbfs

real    0m16.647s
user    0m13.597s
sys    0m1.956s
6c7939e99feba22f06d2f55d3f45d09d SX4E01.wbfs

real    0m15.956s
user    0m13.156s
sys    0m2.368s
6c7939e99feba22f06d2f55d3f45d09d SX4E01.wbfs

real    0m15.112s
user    0m12.617s
sys    0m2.150s
 
Last edited by Monado_III,
  • Like
Reactions: Jayro

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • Materia_tofu @ Materia_tofu:
    hey sylv? do you know why gameyob crashes on the EZP?
  • Materia_tofu @ Materia_tofu:
    @SylverReZ forgor to tag lol
  • SylverReZ @ SylverReZ:
    @Materia_tofu, Maybe ask the EZ-Flash team.
  • Materia_tofu @ Materia_tofu:
    maybe tomorrow lol
  • SylverReZ @ SylverReZ:
    You can make a post on the DS forum about your findings, and they'll do their best to respond. They have a GBAtemp account here, you know.
  • Materia_tofu @ Materia_tofu:
    oh ye i made a post i did forget they had an account i prob shouldve tagged them in the post
    tbh
    +1
  • SylverReZ @ SylverReZ:
    @Materia_tofu, Would've been a great idea, because they'll notice.
    +1
  • Materia_tofu @ Materia_tofu:
    im not a very bright individual, but we live and we learn
  • SylverReZ @ SylverReZ:
    @Materia_tofu, We do learn a lot from plenty of talented individuals.
  • Materia_tofu @ Materia_tofu:
    this is true! i learned how to make soundfont remixes from a friend back in 2021
    +1
  • BakerMan @ BakerMan:
    Update on my brother: He's home now, tired and hungry, obviously, but other than that, seems to be doing fine.
    +2
  • Veho @ Veho:
    That's a relief to hear. Do you know what happened?
  • SylverReZ @ SylverReZ:
    @BakerMan, Any idea what happened? I hope that your brother's doing good.
  • BakerMan @ BakerMan:
    Well, from what I've heard from my parents, he had a seizure last night, perhaps an epileptic episode, fucking died, had a near death experience, my dad called the paramedics, they showed up, took him to the hospital, and he woke up covered in tubes, and started complaining.
  • BakerMan @ BakerMan:
    He couldn't eat until after his MRI, when he had a bomb pop.
  • BakerMan @ BakerMan:
    What matters now is that he's doing alright.
  • Veho @ Veho:
    But you still don't know what it was?
  • Veho @ Veho:
    Has he had seizures before?
  • The Real Jdbye @ The Real Jdbye:
    apparently stress can cause seizures, my brother had one during a test once
  • The Real Jdbye @ The Real Jdbye:
    never had one before that, and never had one since
  • Redleviboy123 @ Redleviboy123:
    Question about game texture chanching Do i need an own game id?
  • The Real Jdbye @ The Real Jdbye:
    @Veho for those that want to
    experience being sonic the hedgehog
  • Veho @ Veho:
    Ah, you mean
    furries.
    Veho @ Veho: Ah, you mean furries.