diff options
author | Mike Buland <eichlan@xagasoft.com> | 2010-04-23 15:14:00 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2010-04-23 15:14:00 +0000 |
commit | 801e7de1f85656746d832508baf4583907826420 (patch) | |
tree | 6e2639b6904ee8bcef2781420741124948c17f2c /src/md5.cpp | |
parent | d8a8c482b2f6b09ee8995b9563397a9b9bd135e8 (diff) | |
download | libbu++-801e7de1f85656746d832508baf4583907826420.tar.gz libbu++-801e7de1f85656746d832508baf4583907826420.tar.bz2 libbu++-801e7de1f85656746d832508baf4583907826420.tar.xz libbu++-801e7de1f85656746d832508baf4583907826420.zip |
Minor updates to the List class, unchecked corner cases.
The CsvWriter now writes csv. It understands both excel formatting and c-style,
which I made up myself (it's just c-style escape sequences).
Sha1 is converted to work with the CryptoHash API and it does indeed work.
Diffstat (limited to '')
-rw-r--r-- | src/md5.cpp | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/src/md5.cpp b/src/md5.cpp index cfb1e6e..abf4bfa 100644 --- a/src/md5.cpp +++ b/src/md5.cpp | |||
@@ -98,24 +98,6 @@ void Bu::Md5::writeResult( Bu::Stream &sOut ) | |||
98 | sOut.write( lsum, 4*4 ); | 98 | sOut.write( lsum, 4*4 ); |
99 | } | 99 | } |
100 | 100 | ||
101 | Bu::FString Bu::Md5::getHexResult() | ||
102 | { | ||
103 | static const char hex_tab[] = {"0123456789abcdef"}; | ||
104 | char str[33]; | ||
105 | |||
106 | long lsum[4]; | ||
107 | compCap( lsum ); | ||
108 | |||
109 | int k = 0; | ||
110 | for( int i = 0; i < 16; i++ ) | ||
111 | { | ||
112 | str[k++] = hex_tab[(lsum[i>>2] >> ((i%4)*8+4)) & 0xF]; | ||
113 | str[k++] = hex_tab[(lsum[i>>2] >> ((i%4)*8 )) & 0xF]; | ||
114 | } | ||
115 | |||
116 | return Bu::FString( str, 32 ); | ||
117 | } | ||
118 | |||
119 | void Bu::Md5::compCap( long *sumout ) | 101 | void Bu::Md5::compCap( long *sumout ) |
120 | { | 102 | { |
121 | memcpy( sumout, sum, 4*4 ); | 103 | memcpy( sumout, sum, 4*4 ); |