diff options
author | Mike Buland <eichlan@xagasoft.com> | 2009-08-04 05:24:13 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2009-08-04 05:24:13 +0000 |
commit | 9e48c6f7d602364eb1c18de7e1e4c00e4852839c (patch) | |
tree | 0f4ba529a0d58453227b7cddc429ed97494a14ef /src/tests/md5.cpp | |
parent | 6e6402825bcd6021d62fd2eb8a0669641fe9c266 (diff) | |
download | libbu++-9e48c6f7d602364eb1c18de7e1e4c00e4852839c.tar.gz libbu++-9e48c6f7d602364eb1c18de7e1e4c00e4852839c.tar.bz2 libbu++-9e48c6f7d602364eb1c18de7e1e4c00e4852839c.tar.xz libbu++-9e48c6f7d602364eb1c18de7e1e4c00e4852839c.zip |
***IMPORTANT*** The function Bu::Md5::getResult no longer returns a hex string,
it returns the raw binary string that makes up the md5 sum, this matches the
original goal of the API and makes the whole system more general and
transportable. I have added a handy helper function named getHexResult that
will return the same classic hex md5 string we're used to, change anything in
your code that uses getResult to getHexResult now.
I've also added a handy function to the CryptoHash to write the result to a
stream, writeResult. I've fixed some more things in the formatter, and added
a cryptPass function that works very much like the system crypt function, md5
and base64. If I knew more about the glibc implementation I could probably
make them compatible. For now there are some subtle differences in the
formatting and the salting algorithm, also the output mantains it's base64
trailer (==) wheras the system function chops those off. There's also another
helper that will only work on linux for now, that only takes the password, and
generates a salt for you using urandom.
Diffstat (limited to 'src/tests/md5.cpp')
-rw-r--r-- | src/tests/md5.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tests/md5.cpp b/src/tests/md5.cpp index 3b3d5e7..69ddd1d 100644 --- a/src/tests/md5.cpp +++ b/src/tests/md5.cpp | |||
@@ -28,7 +28,7 @@ int main( int argc, char *argv[] ) | |||
28 | break; | 28 | break; |
29 | } | 29 | } |
30 | 30 | ||
31 | sio << m.getResult() << " *" << *argv << sio.nl; | 31 | sio << m.getHexResult() << " *" << *argv << sio.nl; |
32 | } | 32 | } |
33 | } | 33 | } |
34 | 34 | ||