lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi folks.
I'm using LuaForWindows (migrating from perl for various reasons) and I wonder, how to calculate MD5 over huge files (e.g. ISO-Files).

In perl I can add files via a handle to a sum (excuse the use of a foreign language in this group ;-)

   $MD5->reset;
   open(FILE,$file) or die "open($file) failed($!)\n";
   binmode(FILE);
   $MD5->addfile(*FILE);
   close(FILE);
   my $hex=$MD5->hexdigest;

In lua I've only found the module md5, which provides

    md5.sumhexa(message)

but this requires reading the whole message into memory, which is quite impossible for 7GB large files.
Is there any other solution?

Regards Jørgen