ldaphotos/sources/manipulations.c
Sandy Mossgrave 39a69c947e Quicksaving before first run on coldspringsharbor.
Added manipulations.c, which turns an array of bytes
into their hex representation.

Added a completely useless test suite.

Added manifesto.tex, which is, well, a dramatic name
for my notes to self and plan.

Added local.schema, which will be used by LDAP later on when
actually registering the photos in a database.
2023-06-19 08:56:49 +00:00

16 lines
377 B
C

#include <stdlib.h> // malloc
#include <stdio.h> // sprintf
char * atohex(unsigned char * a, size_t len, unsigned int * aalen){
char *aa;
//two bytes of output per byte of input, plus newline
(*aalen) = 2 * len * sizeof *aa + 1;
aa = (char*)malloc((*aalen));
for(int i = 0; i < len; i++){
sprintf(aa + (2 * i), "%02x", a[i]);
}
aa[(*aalen)-1] = '\n';
return aa;
}