Adding object table (#1)

* code for maintaining the object table

* Makefile fix

* Clone git submodules.

* directory -> object_table

* Fix Makefile and remove unnecessary files.

* Fix formatting.

* make code more generic
This commit is contained in:
Philipp Moritz
2016-09-13 18:54:26 -07:00
committed by Robert Nishihara
parent a35de3b287
commit 7d629d4e48
21 changed files with 2322 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
#include "common.h"
char *sha1_to_hex(const unsigned char *sha1, char *buffer) {
static const char hex[] = "0123456789abcdef";
char *buf = buffer;
for (int i = 0; i < UNIQUE_ID_SIZE; i++) {
unsigned int val = *sha1++;
*buf++ = hex[val >> 4];
*buf++ = hex[val & 0xf];
}
*buf = '\0';
return buffer;
}