aboutsummaryrefslogtreecommitdiff
path: root/src/stable/pearsonhash.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2012-11-05 22:41:51 +0000
committerMike Buland <eichlan@xagasoft.com>2012-11-05 22:41:51 +0000
commitec05778d5718a7912e506764d443a78d6a6179e3 (patch)
tree78a9a01532180030c095acefc45763f07c14edb8 /src/stable/pearsonhash.cpp
parentb20414ac1fe80a71a90601f4cd1767fa7014a9ba (diff)
downloadlibbu++-ec05778d5718a7912e506764d443a78d6a6179e3.tar.gz
libbu++-ec05778d5718a7912e506764d443a78d6a6179e3.tar.bz2
libbu++-ec05778d5718a7912e506764d443a78d6a6179e3.tar.xz
libbu++-ec05778d5718a7912e506764d443a78d6a6179e3.zip
Converted tabs to spaces with tabconv.
Diffstat (limited to 'src/stable/pearsonhash.cpp')
-rw-r--r--src/stable/pearsonhash.cpp50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/stable/pearsonhash.cpp b/src/stable/pearsonhash.cpp
index d4e82df..6f58470 100644
--- a/src/stable/pearsonhash.cpp
+++ b/src/stable/pearsonhash.cpp
@@ -9,28 +9,28 @@
9#include "bu/stream.h" 9#include "bu/stream.h"
10 10
11uint8_t Bu::PearsonHash::aSBox[] = { 11uint8_t Bu::PearsonHash::aSBox[] = {
12 251, 175, 119, 215, 81, 14, 79, 191, 103, 49, 181, 143, 186, 157, 0, 12 251, 175, 119, 215, 81, 14, 79, 191, 103, 49, 181, 143, 186, 157, 0,
13 232, 31, 32, 55, 60, 152, 58, 17, 237, 174, 70, 160, 144, 220, 90, 57, 13 232, 31, 32, 55, 60, 152, 58, 17, 237, 174, 70, 160, 144, 220, 90, 57,
14 223, 59, 3, 18, 140, 111, 166, 203, 196, 134, 243, 124, 95, 222, 179, 14 223, 59, 3, 18, 140, 111, 166, 203, 196, 134, 243, 124, 95, 222, 179,
15 197, 65, 180, 48, 36, 15, 107, 46, 233, 130, 165, 30, 123, 161, 209, 23, 15 197, 65, 180, 48, 36, 15, 107, 46, 233, 130, 165, 30, 123, 161, 209, 23,
16 97, 16, 40, 91, 219, 61, 100, 10, 210, 109, 250, 127, 22, 138, 29, 108, 16 97, 16, 40, 91, 219, 61, 100, 10, 210, 109, 250, 127, 22, 138, 29, 108,
17 244, 67, 207, 9, 178, 204, 74, 98, 126, 249, 167, 116, 34, 77, 193, 17 244, 67, 207, 9, 178, 204, 74, 98, 126, 249, 167, 116, 34, 77, 193,
18 200, 121, 5, 20, 113, 71, 35, 128, 13, 182, 94, 25, 226, 227, 199, 75, 18 200, 121, 5, 20, 113, 71, 35, 128, 13, 182, 94, 25, 226, 227, 199, 75,
19 27, 41, 245, 230, 224, 43, 225, 177, 26, 155, 150, 212, 142, 218, 115, 19 27, 41, 245, 230, 224, 43, 225, 177, 26, 155, 150, 212, 142, 218, 115,
20 241, 73, 88, 105, 39, 114, 62, 255, 192, 201, 145, 214, 168, 158, 221, 20 241, 73, 88, 105, 39, 114, 62, 255, 192, 201, 145, 214, 168, 158, 221,
21 148, 154, 122, 12, 84, 82, 163, 44, 139, 228, 236, 205, 242, 217, 11, 21 148, 154, 122, 12, 84, 82, 163, 44, 139, 228, 236, 205, 242, 217, 11,
22 187, 146, 159, 64, 86, 239, 195, 42, 106, 198, 118, 112, 184, 172, 87, 22 187, 146, 159, 64, 86, 239, 195, 42, 106, 198, 118, 112, 184, 172, 87,
23 2, 173, 117, 176, 229, 247, 253, 137, 185, 99, 164, 102, 147, 45, 66, 23 2, 173, 117, 176, 229, 247, 253, 137, 185, 99, 164, 102, 147, 45, 66,
24 231, 52, 141, 211, 194, 206, 246, 238, 56, 110, 78, 248, 63, 240, 189, 24 231, 52, 141, 211, 194, 206, 246, 238, 56, 110, 78, 248, 63, 240, 189,
25 93, 92, 51, 53, 183, 19, 171, 72, 50, 33, 104, 101, 69, 8, 252, 83, 120, 25 93, 92, 51, 53, 183, 19, 171, 72, 50, 33, 104, 101, 69, 8, 252, 83, 120,
26 76, 135, 85, 54, 202, 125, 188, 213, 96, 235, 136, 208, 162, 129, 190, 26 76, 135, 85, 54, 202, 125, 188, 213, 96, 235, 136, 208, 162, 129, 190,
27 132, 156, 38, 47, 1, 7, 254, 24, 4, 216, 131, 89, 21, 28, 133, 37, 153, 27 132, 156, 38, 47, 1, 7, 254, 24, 4, 216, 131, 89, 21, 28, 133, 37, 153,
28 149, 80, 170, 68, 6, 169, 234, 151 28 149, 80, 170, 68, 6, 169, 234, 151
29}; 29};
30 30
31Bu::PearsonHash::PearsonHash() 31Bu::PearsonHash::PearsonHash()
32{ 32{
33 reset(); 33 reset();
34} 34}
35 35
36Bu::PearsonHash::~PearsonHash() 36Bu::PearsonHash::~PearsonHash()
@@ -39,7 +39,7 @@ Bu::PearsonHash::~PearsonHash()
39 39
40void Bu::PearsonHash::reset() 40void Bu::PearsonHash::reset()
41{ 41{
42 iValue = 0; 42 iValue = 0;
43} 43}
44 44
45void Bu::PearsonHash::setSalt( const Bu::String & /*sSalt*/ ) 45void Bu::PearsonHash::setSalt( const Bu::String & /*sSalt*/ )
@@ -48,19 +48,19 @@ void Bu::PearsonHash::setSalt( const Bu::String & /*sSalt*/ )
48 48
49void Bu::PearsonHash::addData( const void *sData, int iSize ) 49void Bu::PearsonHash::addData( const void *sData, int iSize )
50{ 50{
51 for( int j = 0; j < iSize; j++ ) 51 for( int j = 0; j < iSize; j++ )
52 { 52 {
53 iValue = aSBox[ iValue^((unsigned char *)sData)[j] ]; 53 iValue = aSBox[ iValue^((unsigned char *)sData)[j] ];
54 } 54 }
55} 55}
56 56
57Bu::String Bu::PearsonHash::getResult() 57Bu::String Bu::PearsonHash::getResult()
58{ 58{
59 return Bu::String((char)iValue); 59 return Bu::String((char)iValue);
60} 60}
61 61
62void Bu::PearsonHash::writeResult( Stream &sOut ) 62void Bu::PearsonHash::writeResult( Stream &sOut )
63{ 63{
64 sOut.write( &iValue, 1 ); 64 sOut.write( &iValue, 1 );
65} 65}
66 66