md5test.pp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. {
  2. $Id$
  3. This file is part of the Free Pascal packages.
  4. Copyright (c) 1999-2000 by the Free Pascal development team
  5. Tests the MD5 program.
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. program md5test;
  13. {$h+}
  14. uses md5;
  15. var
  16. I: byte;
  17. const
  18. Suite: array[1..7] of string = (
  19. '',
  20. 'a',
  21. 'abc',
  22. 'message digest',
  23. 'abcdefghijklmnopqrstuvwxyz',
  24. 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',
  25. '12345678901234567890123456789012345678901234567890123456789012345678901234567890'
  26. );
  27. begin
  28. Writeln('Executing RFC 1321 test suite ...');
  29. for I := 1 to 7 do
  30. Writeln('MD5 ("',Suite[i],'") = ',MD5Print(MD5String(Suite[I])));
  31. Writeln();
  32. Writeln('md5file (50) : ',md5print(Md5File('md5test.pas',50)));
  33. Writeln('md5file (def) : ',md5print(Md5File('md5test.pas')));
  34. end.