Back to index

courier  0.68.2
Functions
random128binary.c File Reference
#include <ctype.h>
#include <string.h>
#include "random128.h"

Go to the source code of this file.

Functions

static int nyb (char c)
void random128_binary (random128binbuf *bytes)

Function Documentation

static int nyb ( char  c) [static]

Definition at line 18 of file random128binary.c.

{
       static const char xdigit[]="0123456789ABCDEF";

       const char *p=strchr(xdigit, c);

       if (p)
              return (p-xdigit);
       return 0;
}

Here is the caller graph for this function:

void random128_binary ( random128binbuf bytes)

Definition at line 29 of file random128binary.c.

{
       char randombuf[ 128 / 8 * 2 + 1];
       int i;

       strcpy(randombuf, random128());

       for (i=0; i<128/8; i++)
              (*bytes)[i]=(nyb(randombuf[i*2]) << 4) | nyb(randombuf[i*2+1]);
}

Here is the call graph for this function:

Here is the caller graph for this function: