diff options
Diffstat (limited to 'src/stable/cryptohash.cpp')
-rw-r--r-- | src/stable/cryptohash.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/stable/cryptohash.cpp b/src/stable/cryptohash.cpp index dda734c..99a7d92 100644 --- a/src/stable/cryptohash.cpp +++ b/src/stable/cryptohash.cpp | |||
@@ -17,22 +17,22 @@ Bu::CryptoHash::~CryptoHash() | |||
17 | 17 | ||
18 | void Bu::CryptoHash::addData( const Bu::String &sData ) | 18 | void Bu::CryptoHash::addData( const Bu::String &sData ) |
19 | { | 19 | { |
20 | addData( sData.getStr(), sData.getSize() ); | 20 | addData( sData.getStr(), sData.getSize() ); |
21 | } | 21 | } |
22 | 22 | ||
23 | Bu::String Bu::CryptoHash::getHexResult() | 23 | Bu::String Bu::CryptoHash::getHexResult() |
24 | { | 24 | { |
25 | Bu::String sResult = getResult(); | 25 | Bu::String sResult = getResult(); |
26 | Bu::String sRet( 2*sResult.getSize() ); | 26 | Bu::String sRet( 2*sResult.getSize() ); |
27 | static const char hex_tab[] = {"0123456789abcdef"}; | 27 | static const char hex_tab[] = {"0123456789abcdef"}; |
28 | 28 | ||
29 | int k = 0; | 29 | int k = 0; |
30 | for( int i = 0; i < sResult.getSize(); i++ ) | 30 | for( int i = 0; i < sResult.getSize(); i++ ) |
31 | { | 31 | { |
32 | sRet[k++] = hex_tab[(((unsigned char)sResult[i])>>4) & 0xF]; | 32 | sRet[k++] = hex_tab[(((unsigned char)sResult[i])>>4) & 0xF]; |
33 | sRet[k++] = hex_tab[((unsigned char)sResult[i]) & 0xF]; | 33 | sRet[k++] = hex_tab[((unsigned char)sResult[i]) & 0xF]; |
34 | } | 34 | } |
35 | 35 | ||
36 | return sRet; | 36 | return sRet; |
37 | } | 37 | } |
38 | 38 | ||