]> git.ipfire.org Git - thirdparty/git.git/blobdiff - cache.h
Add structure representing hash algorithm
[thirdparty/git.git] / cache.h
diff --git a/cache.h b/cache.h
index d74f00d8db2035c5109e2bf00a1ea25c14c7f24c..cb7fb7c004beb0b228269469a2c389c248bb72d1 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -1340,6 +1340,13 @@ extern int set_disambiguate_hint_config(const char *var, const char *value);
 extern int get_sha1_hex(const char *hex, unsigned char *sha1);
 extern int get_oid_hex(const char *hex, struct object_id *sha1);
 
+/*
+ * Read `len` pairs of hexadecimal digits from `hex` and write the
+ * values to `binary` as `len` bytes. Return 0 on success, or -1 if
+ * the input does not consist of hex digits).
+ */
+extern int hex_to_bytes(unsigned char *binary, const char *hex, size_t len);
+
 /*
  * Convert a binary sha1 to its hex equivalent. The `_r` variant is reentrant,
  * and writes the NUL-terminated output to the buffer `out`, which must be at