From f4c20290509d7ed3a8fd5304577e7a4cc0b9d974 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 3 Apr 2007 03:49:53 +0000 Subject: Ok, no code is left in src, it's all in src/old. We'll gradually move code back into src as it's fixed and re-org'd. This includes tests, which, I may write a unit test system into libbu++ just to make my life easier. --- src/tests/sha1.cpp | 44 -------------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 src/tests/sha1.cpp (limited to 'src/tests/sha1.cpp') diff --git a/src/tests/sha1.cpp b/src/tests/sha1.cpp deleted file mode 100644 index df3113c..0000000 --- a/src/tests/sha1.cpp +++ /dev/null @@ -1,44 +0,0 @@ -#include "sha1.h" -#include "sfile.h" - -#define BS 1024 - -int main( int argc, char *argv[] ) -{ - argc--; argv++; - - if( argc == 0 ) - { - printf("Provide a filename.\n"); - return 0; - } - - char buf[BS]; - - Sha1 s; - SFile fin( *argv, "rb" ); - for(;;) - { - int nRead = fin.read( buf, BS ); - if( nRead == 0 ) - break; - - s.update( buf, nRead ); - if( nRead < BS ) - break; - } - - unsigned char *dig = s.getDigest(); - - char val[]={"0123456789ABCDEF"}; - - for( int j = 0; j < 20; j++ ) - { - putchar( val[dig[j]>>4] ); - putchar( val[dig[j]&0x0F] ); - } - putchar('\n'); - - delete[] dig; -} - -- cgit v1.2.3