Main Page   File List   File Members   Related Pages  

frdi_lib.h File Reference

declaration of methods in frdi_lib.c More...

Go to the source code of this file.

Functions

char * frdiTimestampNow ()
char * frdiHashTiger (char *message)
char * frdiHash (char *message)
void * frdiMemoryAllocate (int size)
void frdiMemoryFree (void *ptr)
frdi_bigint * frdiBigintNew (frdi_app *self)
char * frdiBigintToHex (frdi_app *self, frdi_bigint *num)
frdi_bigint * frdiHexToBigint (frdi_app *self, char *str)
int frdiRandInt (frdi_app *self, int start, int finish)
frdi_bigint * frdiRandBigint (frdi_app *self, frdi_bigint *finish, frdi_seed *seed)
frdi_seed * frdiRandSeedNew (frdi_app *self, char *randomness)
char * frdiRandGenerate (frdi_app *self)


Detailed Description

declaration of methods in frdi_lib.c

Author:
Douglas Reay <douglas-legal@reay.org>
Warning:

Function Documentation

char* frdiTimestampNow (    ) 
 

returns the current time as a string YYYY-MM-DD HH:MM:SS uses the UTC timezone to ensure coordination between clients and servers in different timezones. CHANGED TO: timestamp - YYYY-MM-DDThh:mm:ssTZ http://www.w3.org/TR/html4/types.html#h-6.5

char* frdiHashTiger (  char *    message ) 
 

uses the Tiger message digest algorithm to create a digest of a message

char* frdiHash (  char *    message ) 
 

I havn't decided yet what to do about allowing multiple algorithms. For now this defaults to Tiger.

void* frdiMemoryAllocate (  int    size ) 
 

Put here to allow easy later aleration to a more efficient mechanism. There should be no direct calls to malloc() from anywhere else.

void frdiMemoryFree (  void *    ptr ) 
 

Put here to allow easy later aleration to a more efficient mechanism. There should be no direct calls to free() from anywhere else.

frdi_bigint* frdiBigintNew (  frdi_app *    self ) 
 

returns a correctly initialised pointer to a frdi_bigint

char* frdiBigintToHex (  frdi_app *    self,
frdi_bigint *    num
) 
 

frdi_bigint * -> char* hex string

frdi_bigint* frdiHexToBigint (  frdi_app *    self,
char *    str
) 
 

char* hex string -> frdi_bigint *

int frdiRandInt (  frdi_app *    self,
int    start,
int    finish
) 
 

Returns a random integer between start and finish, inclusive

frdi_bigint* frdiRandBigint (  frdi_app *    self,
frdi_bigint *    finish,
frdi_seed *    seed
) 
 

Returns a random bigint between 0 and finish - 1

frdi_seed* frdiRandSeedNew (  frdi_app *    self,
char *    randomness
) 
 

Returns a seed (used to keep state for random()) we use the tiger hash of randomness as the salt

char* frdiRandGenerate (  frdi_app *    self ) 
 

generate a string containing randomness the time, the process currently running, our ip address


Generated on Wed Aug 18 13:24:00 2004 for Project Fairdice by doxygen1.2.18