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-01-14T13·51+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2005-01-14T13·51+0000
commit9530cc31700f68fd229eee69eabd2baa099f404a (patch)
tree5cc317adeb0c8098d8a9197a0bcbcb29ee4d941d /src/libutil/hash.cc
parenta7b94e87d7d28f763a708876cba46c8f2484b526 (diff)
* Start move towards SHA-256 hashes instead of MD5.
* Start cleaning up unique store path generation (they weren't always
  unique; in particular the suffix ("-aterm-2.2", "-builder.sh") was
  not part of the hash, therefore changes to the suffix would cause
  multiple store objects with the same hash).

Diffstat (limited to 'src/libutil/hash.cc')
-rw-r--r--src/libutil/hash.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libutil/hash.cc b/src/libutil/hash.cc
index 599d375dca..cd7043090e 100644
--- a/src/libutil/hash.cc
+++ b/src/libutil/hash.cc
@@ -22,6 +22,7 @@ Hash::Hash(HashType type)
     else if (type == htSHA1) hashSize = sha1HashSize;
     else if (type == htSHA256) hashSize = sha256HashSize;
     else throw Error("unknown hash type");
+    assert(hashSize <= maxHashSize);
     memset(hash, 0, hashSize);
 }