mirror of
https://tinyplantnews.com/git2/ldaphotos
synced 2025-01-10 10:25:15 +00:00
39a69c947e
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.
16 lines
377 B
C
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;
|
|
}
|