about summary refs log tree commit diff
path: root/src/libutil/hash.cc
diff options
context:
space:
mode:
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;