diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2005-01-14T12·03+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2005-01-14T12·03+0000 |
commit | 63791eb05b236afcea510d769a8943f8be3dbc9c (patch) | |
tree | 48b25ce1d2336bc41ab838475d915a7d01134e98 /src/libutil/hash.hh | |
parent | 37b51a9aa6d5d0fb97bad0d1a27d27304da277c2 (diff) |
* Add SHA-256.
* Tests for the various hashes.
Diffstat (limited to 'src/libutil/hash.hh')
-rw-r--r-- | src/libutil/hash.hh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libutil/hash.hh b/src/libutil/hash.hh index 1d2fce6455c6..d82cd87a2166 100644 --- a/src/libutil/hash.hh +++ b/src/libutil/hash.hh @@ -8,11 +8,12 @@ using namespace std; -typedef enum { htMD5, htSHA1 } HashType; +typedef enum { htMD5, htSHA1, htSHA256 } HashType; const int md5HashSize = 16; const int sha1HashSize = 20; +const int sha256HashSize = 32; struct Hash @@ -53,8 +54,7 @@ Hash hashString(const string & s, HashType ht); Hash hashFile(const Path & path, HashType ht); /* Compute the hash of the given path. The hash is defined as - md5(dump(path)). -*/ + md5(dump(path)). */ Hash hashPath(const Path & path, HashType ht); |