#ifndef HASHMAP_H
#define HASHMAP_H
+#include "hash.h"
+
/*
* Generic implementation of hash-based key-value mappings.
*
* the results will be different on big-endian and little-endian
* platforms, so they should not be stored or transferred over the net.
*/
-static inline unsigned int sha1hash(const unsigned char *sha1)
+static inline unsigned int oidhash(const struct object_id *oid)
{
/*
- * Equivalent to 'return *(unsigned int *)sha1;', but safe on
+ * Equivalent to 'return *(unsigned int *)oid->hash;', but safe on
* platforms that don't support unaligned reads.
*/
unsigned int hash;
- memcpy(&hash, sha1, sizeof(hash));
+ memcpy(&hash, oid->hash, sizeof(hash));
return hash;
}