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.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/libutil/hash.cc b/src/libutil/hash.cc
index b69c14832877..16597fd47cbf 100644
--- a/src/libutil/hash.cc
+++ b/src/libutil/hash.cc
@@ -15,12 +15,16 @@ extern "C" {
 
 #include "hash.hh"
 #include "archive.hh"
+#include "util.hh"
 
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 
 
+namespace nix {
+
+
 Hash::Hash()
 {
     type = htUnknown;
@@ -89,9 +93,9 @@ Hash parseHash(HashType ht, const string & s)
         string s2(s, i * 2, 2);
         if (!isxdigit(s2[0]) || !isxdigit(s2[1])) 
             throw Error(format("invalid hash `%1%'") % s);
-        istringstream str(s2);
+        std::istringstream str(s2);
         int n;
-        str >> hex >> n;
+        str >> std::hex >> n;
         hash.hash[i] = n;
     }
     return hash;
@@ -313,3 +317,6 @@ HashType parseHashType(const string & s)
     else if (s == "sha256") return htSHA256;
     else return htUnknown;
 }
+
+ 
+}