summaryrefslogtreecommitdiff
path: root/src/cryptohash.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cryptohash.cpp')
-rw-r--r--src/cryptohash.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/cryptohash.cpp b/src/cryptohash.cpp
index c3cb8b5..8aee415 100644
--- a/src/cryptohash.cpp
+++ b/src/cryptohash.cpp
@@ -20,3 +20,19 @@ void Bu::CryptoHash::addData( const Bu::FString &sData )
20 addData( sData.getStr(), sData.getSize() ); 20 addData( sData.getStr(), sData.getSize() );
21} 21}
22 22
23Bu::FString Bu::CryptoHash::getHexResult()
24{
25 Bu::FString sResult = getResult();
26 Bu::FString sRet( 2*sResult.getSize() );
27 static const char hex_tab[] = {"0123456789abcdef"};
28
29 int k = 0;
30 for( int i = 0; i < sResult.getSize(); i++ )
31 {
32 sRet[k++] = hex_tab[(((unsigned char)sResult[i])>>4) & 0xF];
33 sRet[k++] = hex_tab[((unsigned char)sResult[i]) & 0xF];
34 }
35
36 return sRet;
37}
38