aboutsummaryrefslogtreecommitdiff
path: root/src/tests/sha1.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2007-07-03 00:28:59 +0000
committerMike Buland <eichlan@xagasoft.com>2007-07-03 00:28:59 +0000
commitac517a2b7625e0aa0862679e961c6349f859ea3b (patch)
treee3e27a6b9bd5e2be6150088495c91fc91786ad9d /src/tests/sha1.cpp
parentf8d4301e9fa4f3709258505941e37fab2eadadc6 (diff)
parentbd865cee5f89116c1f054cd0e5c275e97c2d0a9b (diff)
downloadlibbu++-ac517a2b7625e0aa0862679e961c6349f859ea3b.tar.gz
libbu++-ac517a2b7625e0aa0862679e961c6349f859ea3b.tar.bz2
libbu++-ac517a2b7625e0aa0862679e961c6349f859ea3b.tar.xz
libbu++-ac517a2b7625e0aa0862679e961c6349f859ea3b.zip
The reorg is being put in trunk, I think it's ready. Now we just get to find
out how many applications won't work anymore :)
Diffstat (limited to 'src/tests/sha1.cpp')
-rw-r--r--src/tests/sha1.cpp44
1 files changed, 0 insertions, 44 deletions
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 @@
1#include "sha1.h"
2#include "sfile.h"
3
4#define BS 1024
5
6int main( int argc, char *argv[] )
7{
8 argc--; argv++;
9
10 if( argc == 0 )
11 {
12 printf("Provide a filename.\n");
13 return 0;
14 }
15
16 char buf[BS];
17
18 Sha1 s;
19 SFile fin( *argv, "rb" );
20 for(;;)
21 {
22 int nRead = fin.read( buf, BS );
23 if( nRead == 0 )
24 break;
25
26 s.update( buf, nRead );
27 if( nRead < BS )
28 break;
29 }
30
31 unsigned char *dig = s.getDigest();
32
33 char val[]={"0123456789ABCDEF"};
34
35 for( int j = 0; j < 20; j++ )
36 {
37 putchar( val[dig[j]>>4] );
38 putchar( val[dig[j]&0x0F] );
39 }
40 putchar('\n');
41
42 delete[] dig;
43}
44