aboutsummaryrefslogtreecommitdiff
path: root/src/stable/pearsonhash.h
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.h
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.h')
-rw-r--r--src/stable/pearsonhash.h54
1 files changed, 27 insertions, 27 deletions
diff --git a/src/stable/pearsonhash.h b/src/stable/pearsonhash.h
index ca377c1..ece1d40 100644
--- a/src/stable/pearsonhash.h
+++ b/src/stable/pearsonhash.h
@@ -12,35 +12,35 @@
12 12
13namespace Bu 13namespace Bu
14{ 14{
15 /** 15 /**
16 * A pearson hash is a non-cryptographically secure hashing function that 16 * A pearson hash is a non-cryptographically secure hashing function that
17 * is very light on resources, very fast, and produces a single byte 17 * is very light on resources, very fast, and produces a single byte
18 * as it's output. It is strongly dependant on every byte in the input, 18 * as it's output. It is strongly dependant on every byte in the input,
19 * which means that it's a good choice for adding to short messages to 19 * which means that it's a good choice for adding to short messages to
20 * ensure that the contents of the messages are unchanged. 20 * ensure that the contents of the messages are unchanged.
21 * 21 *
22 * Pearson hash is named for it's inventor Peter K. Pearson who described 22 * Pearson hash is named for it's inventor Peter K. Pearson who described
23 * it in his article "Fast hashing of variable-length text strings" 23 * it in his article "Fast hashing of variable-length text strings"
24 * published in 1990 by ACM. I haven't read it, because you have to pay to 24 * published in 1990 by ACM. I haven't read it, because you have to pay to
25 * get a copy :-P 25 * get a copy :-P
26 */ 26 */
27 class PearsonHash : public Bu::CryptoHash 27 class PearsonHash : public Bu::CryptoHash
28 { 28 {
29 public: 29 public:
30 PearsonHash(); 30 PearsonHash();
31 virtual ~PearsonHash(); 31 virtual ~PearsonHash();
32 32
33 virtual void reset(); 33 virtual void reset();
34 virtual void setSalt( const Bu::String &sSalt ); 34 virtual void setSalt( const Bu::String &sSalt );
35 virtual void addData( const void *sData, int iSize ); 35 virtual void addData( const void *sData, int iSize );
36 using Bu::CryptoHash::addData; 36 using Bu::CryptoHash::addData;
37 virtual String getResult(); 37 virtual String getResult();
38 virtual void writeResult( Stream &sOut ); 38 virtual void writeResult( Stream &sOut );
39 39
40 private: 40 private:
41 static uint8_t aSBox[256]; 41 static uint8_t aSBox[256];
42 uint8_t iValue; 42 uint8_t iValue;
43 }; 43 };
44}; 44};
45 45
46#endif 46#endif