
****************************************

"http://freebasic.net/forum/viewtopic.php?t=5288" "MD5 Calculator"

"http://en.wikipedia.org/wiki/MD5"

"http://tools.ietf.org/html/rfc1321"

"http://ibiblio.org/pub/micro/pc-stuff/freedos/files/util/file/"

****************************************

MD5.BAS 39'709 = $9B1D ~ 39 KiB | 2013-02-10
DFB2'CB86'D46F'D1A7'C3E4'C144'C9FC'022D

MD5D.EXE 144'896 = $02'3600 ~ 142 KiB
9145'B9FF'AEB0'DDB9'EE62'DF3E'B45F'F7FC

MD5W.EXE 40'448 = $9E00 ~ 40 KiB
81F8'2277'9100'AA08'9888'9044'E3AA'7DD8

FBMD5.PNG 3'961 = $0F79 ~ 3.9 KiB | Shot (done with EDR-DOS)
C924'6DAB'F33E'0289'5F09'1994'27B7'FA34

FBMD5.LSM 563 | 2013-02-10
B65A'041E'922D'4977'33E7'61CA'7D15'BF61

FBMD5.TXT 4'108

****************************************

RFC1321.TXT "rfc1321.txt" 35'222
C6BEB4140671D319F6433A3399CF6DF2
Downloaded from "http://tools.ietf.org/rfc/rfc1321.txt"

ERR1321.TXT 2'244
DBF796B662B353760BB52F1E0658EBE9
Converted from "http://www.rfc-editor.org/errata_search.php?rfc=1321"

****************************************

Features:
- MD5 Calculator
- DOS (DGJPP-style or Win32 via HX), Win32,
  LinuX86 (source only, untested)
- Faster than TotalCommander and FreeCommander
- Supports files > 4 GiB (up to 128 GiB),
  also in DOS (EDR-DOS only so far)
- Process less than full file size (override)
- Nice output with apo's and BUOB
- Can save output (no need for ">>>>-hack")
- Auto-increment destination filename for saving
  (at least 2 char's, up to 20 attempts)
- Progress indicator, reports performance

What's new 2013-02-10:
- Faster by factor 1.2
- Increased source bloat by factor 2
- Tried to reduce binary bloat (didn't work for
  DGJPP-style DOS binary, blame DGJPP, not me)
- Included INCREDIBLE INCREMENTER and NUMBUOB
- Accepts apo's in input ("$FFFF'FFFF")
- Nicer output with more apo's
- Reports bloat with HEX and BUOB
- Reduced pointer hell in the source
- Dropped one useless buffer
- Various optimizations
- Fixed some faulty comments ("0=1" :-D)
- More fool-proof now: "MD5 MYPROG.C MYPROG.H" will no longer
  overwrite "MYPROG.H" (BUG reported by Rugxulo)
- Auto-increment destination filename, so "MD5 MYPROG.C AA" and
  "MD5 MYPROG.H AA" will produce valid and useful result
- Support for > 4 GiB files on non-DOS (untested)
- Removed FPU requirement on DOS (untested)

License:
MD5 code is (C) 1992 by RSA - fact must be mentioned if code
reused in derivative works, see source.
Other code is (C) 2013 by DOS386 - fact must be mentioned if notable
parts of it reused in derivative works.
Not to be used inside the virtual hell (NTVDM, VirtualPC, ...).

System requirements:
DOS: 80386 CPU | 2 MiB RAM | EDR-DOS 7.01.08, FreeDOS 1.1 or compatible
Non-DOS: FPU (at least 80387) | Enough CPU and RAM to boot up at all

Performance:
Win32 binary via HX is faster than DGJPP-style DOS binary
Tested with UDMA-incapable device and making sure that file is NOT cached
FBMD5 Win32 2013      : FreeDOS + HX 63 s
                        EDR-DOS + HX 53 s
                        Win32 (ME)   50 s <<<--- !!! WINNER !!!
TotalCommander 7.04   :              61 s
FreeCommander 2009.02 :              61 s
Conclusion: TotalCommander and FreeCommander most likely
pirated their poor MD5 implementation from each other ;-)

WARNING:
MD5 is from cryptographical point of view BROKEN. Use SHA256 if you
need an unbreakable (for now) hash algorithm (ready to use tool: 7-ZIP).

ToDo:
- Add SHA256 and CRC32 support
- Process multiple files
- Make it faster
- Reduce bloat
- Control of the output format by commandline
- Improve the progress indicator (waste less screen space, no "99%")
- Decrapify the source, wipe out the remaining pointer hell
- Do something with the commandline ("globalization" & Co)
- Fix GetFileSizeEx is DOS
- Clean up file I/O (FB-vs-C)
- Remove DGJPP and DPMI from DOS binary
- Remove M$WCRT.DLL and other useless dependencies from Win32 binary
- Port it to my (not yet brewn) new OS

****************************************

