Back to index

courier  0.68.2
random128alpha.c
Go to the documentation of this file.
00001 /*
00002 ** Copyright 1998 - 2000 Double Precision, Inc.
00003 ** See COPYING for distribution information.
00004 */
00005 
00006 #if    HAVE_CONFIG_H
00007 #include      "config.h"
00008 #endif
00009 
00010 #if    HAVE_UNISTD_H
00011 #include      <unistd.h>
00012 #endif
00013 #include      <ctype.h>
00014 #include      <string.h>
00015 #include      "random128.h"
00016 
00017 
00018 const char *random128_alpha()
00019 {
00020 static char randombuf[ 128 / 8 * 2 + 1];
00021 char *p;
00022 
00023        strcpy(randombuf, random128());
00024 
00025        for (p=randombuf; *p; p++)
00026               if ( isdigit((int)(unsigned char)*p))
00027                      *p= "GHIJKLMNOP"[ *p - '0' ];
00028        return (randombuf);
00029 }