[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
11,963
Trophies
4
Location
WA State
Website
ko-fi.com
XP
14,700
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,433
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
General chit-chat
Help Users
  • No one is chatting at the moment.
  • JuanMena @ JuanMena:
    Kissing random dudes choking in celery? Really? Need to study for that?
  • K3N1 @ K3N1:
    Yes it requires a degree
  • K3N1 @ K3N1:
    I could also yank out the rest of my teeth but theirs professionals for that
  • x65943 @ x65943:
    If your throat closes, putting oxygen in your mouth will not solve anything - as you will be introducing oxygen prior to the area of obstruction
  • JuanMena @ JuanMena:
    Just kiss me Kyle.
  • x65943 @ x65943:
    You either need to be intubated to bypass obstruction or create a stoma inferior to the the area of obstruction to survive
  • x65943 @ x65943:
    "Just kiss me Kyle." And I thought all the godreborn gay stuff was a smear campaign
  • JuanMena @ JuanMena:
    If I die, tell my momma I won't be carrying Baby Jesus this christmas :sad::cry:
  • K3N1 @ K3N1:
    Smear campaigns are in The political section now?
  • JuanMena @ JuanMena:
    Chary! Chary! Chary, Chary, Chary!
  • Sonic Angel Knight @ Sonic Angel Knight:
    Pork Provolone :P
  • Psionic Roshambo @ Psionic Roshambo:
    Sounds yummy
  • K3N1 @ K3N1:
    Sweet found my Wii u PSU right after I ordered a new one :tpi:
  • JuanMena @ JuanMena:
    It was waiting for you to order another one.
    Seems like, your PSU was waiting for a partner.
  • JuanMena @ JuanMena:
    Keep them both
    separated or you'll have more PSUs each year.
  • K3N1 @ K3N1:
    Well one you insert one PSU into the other one you get power
  • JuanMena @ JuanMena:
    It literally turns it on.
  • K3N1 @ K3N1:
    Yeah power supplies are filthy perverts
  • K3N1 @ K3N1:
    @Psionic Roshambo has a new friend
    +1
  • JuanMena @ JuanMena:
    It's Kyle, the guy that went to school to be a Certified man Kisser.
  • Psionic Roshambo @ Psionic Roshambo:
    Cartmans hand has taco flavored kisses
  • A @ abraarukuk:
    hi guys
  • Iron_Masuku @ Iron_Masuku:
    Hello
    Skelletonike @ Skelletonike: hmm