Imported Upstream version 0.66.1
[hcoop/debian/courier-authlib.git] / libs / random128 / random128alpha.c
1 /*
2 ** Copyright 1998 - 2000 Double Precision, Inc.
3 ** See COPYING for distribution information.
4 */
5
6 #if HAVE_CONFIG_H
7 #include "config.h"
8 #endif
9
10 #if HAVE_UNISTD_H
11 #include <unistd.h>
12 #endif
13 #include <ctype.h>
14 #include <string.h>
15 #include "random128.h"
16
17
18 const char *random128_alpha()
19 {
20 static char randombuf[ 128 / 8 * 2 + 1];
21 char *p;
22
23 strcpy(randombuf, random128());
24
25 for (p=randombuf; *p; p++)
26 if ( isdigit((int)(unsigned char)*p))
27 *p= "GHIJKLMNOP"[ *p - '0' ];
28 return (randombuf);
29 }