mirror of
https://github.com/vale981/ray
synced 2025-03-13 22:56:38 -04:00

* 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
15 lines
326 B
C
15 lines
326 B
C
#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;
|
|
}
|