about summary refs log tree commit diff
path: root/src/libutil/hash.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2005-11-16T08·27+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2005-11-16T08·27+0000
commitb7f008fc353ea05c423fb571047144052ce691c3 (patch)
treed2d62977981a0ba8ab7efecab481d80e617f488b /src/libutil/hash.cc
parent9311ab76a523de516b6bc98afda9e4b790225514 (diff)
* Did something useful while waiting at IAD: reference scanning is now
  much faster.

Diffstat (limited to 'src/libutil/hash.cc')
-rw-r--r--src/libutil/hash.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libutil/hash.cc b/src/libutil/hash.cc
index 271e63665b8f..71d4ba67e2c0 100644
--- a/src/libutil/hash.cc
+++ b/src/libutil/hash.cc
@@ -109,13 +109,15 @@ static unsigned char divMod(unsigned char * bytes, unsigned char y)
 
 
 // omitted: E O U T
-char chars[] = "0123456789abcdfghijklmnpqrsvwxyz";
+const string base32Chars = "0123456789abcdfghijklmnpqrsvwxyz";
 
 
 string printHash32(const Hash & hash)
 {
     Hash hash2(hash);
     unsigned int len = (hash.hashSize * 8 - 1) / 5 + 1;
+
+    const char * chars = base32Chars.c_str();
     
     string s(len, '0');
 
@@ -165,6 +167,8 @@ Hash parseHash32(HashType ht, const string & s)
 {
     Hash hash(ht);
 
+    const char * chars = base32Chars.c_str();
+
     for (unsigned int i = 0; i < s.length(); ++i) {
         char c = s[i];
         unsigned char digit;