with Ada.Command_Line;
use Ada.Command_Line;
with MD5.Driver;
procedure MD5.Test is
--====================================================================
-- Authors Rolf Ebert,
-- Christoph Grein <Christ-Usch.Grein@T-Online.de>
-- Version 1.1
-- Date 16 January 1999
--====================================================================
-- Run the MD5 driver.
--
-- Arguments (may be in any combination):
-- -sstring - digests a string
-- -t - runs time trial
-- -x - runs test script
-- filename - digests file
-- (none) - digests standard input
--
-- This is a direct translation into Ada of the C language Reference
-- Implementation given in the official MD5 algorithm description.
-- It was originally written by Rolf Ebert (unknown address).
-- [See parent package for a reference to the official description.]
--====================================================================
-- History
-- Author Version Date Reason for change
-- R.E. 1.0 04.06.1997 Original as found in internet
-- C.G. 1.1 16.01.1999 Minor code changes;
-- commented to make publication legal
--====================================================================
begin
if Argument_Count > 0 then
for I in 1 .. Argument_Count loop
if Argument (I)(1..2) = "-s" then
MD5.Driver.Digest_String (Argument (I)(3 .. Argument (I)'Last));
elsif Argument (I) = "-t" then
MD5.Driver.Time_Trial;
elsif Argument (I) = "-x" then
MD5.Driver.Test_Suite;
else
MD5.Driver.Digest_File (Argument (I));
end if;
end loop;
else
MD5.Driver.Filter;
end if;
end MD5.Test;
Back to text.