Imported upstream version 0.59.3
[hcoop/debian/courier-authlib.git] / 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 static const char rcsid[]="$Id: random128alpha.c,v 1.2 2000/05/27 04:59:26 mrsam Exp $";
18
19 const char *random128_alpha()
20 {
21 static char randombuf[ 128 / 8 * 2 + 1];
22 char *p;
23
24 strcpy(randombuf, random128());
25
26 for (p=randombuf; *p; p++)
27 if ( isdigit((int)(unsigned char)*p))
28 *p= "GHIJKLMNOP"[ *p - '0' ];
29 return (randombuf);
30 }