forked from lix-project/lix
Fix hashes
This commit is contained in:
parent
c664e68b87
commit
1fcd3afc38
|
@ -19,13 +19,13 @@ namespace nix {
|
||||||
|
|
||||||
void Hash::init()
|
void Hash::init()
|
||||||
{
|
{
|
||||||
if (!type) abort();
|
if (!type) abort();
|
||||||
switch (*type) {
|
switch (*type) {
|
||||||
case HashType::MD5: hashSize = md5HashSize; break;
|
case HashType::MD5: hashSize = md5HashSize; break;
|
||||||
case HashType::SHA1: hashSize = sha1HashSize; break;
|
case HashType::SHA1: hashSize = sha1HashSize; break;
|
||||||
case HashType::SHA256: hashSize = sha256HashSize; break;
|
case HashType::SHA256: hashSize = sha256HashSize; break;
|
||||||
case HashType::SHA512: hashSize = sha512HashSize; break;
|
case HashType::SHA512: hashSize = sha512HashSize; break;
|
||||||
}
|
}
|
||||||
assert(hashSize <= maxHashSize);
|
assert(hashSize <= maxHashSize);
|
||||||
memset(hash, 0, maxHashSize);
|
memset(hash, 0, maxHashSize);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue