]> git.tuebingen.mpg.de Git - osl.git/blobdiff - hash.h
Prepare hash_function() for multiple hash algorithms.
[osl.git] / hash.h
diff --git a/hash.h b/hash.h
index 6244d081e178c69281eb6c3b2dfbcd0e38cfbeaa..08153383218a36bdd664508b920e2725153656b4 100644 (file)
--- a/hash.h
+++ b/hash.h
 
 void sha1_hash(const char *data, unsigned long len, unsigned char *sha1);
 
-/** Our own sha1 implementation, see sha1.c. */
-#define hash_function sha1_hash
+static inline void hash_function(uint8_t table_version, const char *data,
+               unsigned long len, unsigned char *result)
+{
+       assert(table_version == 1);
+       sha1_hash(data, len, result);
+}
 
 /**
  * Compare two hashes.