[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-libc-dev] rand(3) in avr-libc

From: Joerg Wunsch
Subject: Re: [avr-libc-dev] rand(3) in avr-libc
Date: Tue, 10 Sep 2002 20:59:18 +0200
User-agent: Mutt/1.2.5i

As E. Weddington wrote:

> Besides crypto, is there any other use for the heavier 
> PRNG? If there isn't, then it would probably be more of a hassle than 
> it's worth. I mean, unless you (Joerg) *really* wanna do it... :-)

Porting the BSD random(3) module isn't that much work.  I did it
yesterday, maybe it took me 15 minutes or so, basically the `port'
consists of adding a few Ls to the long integer constants. ;-)
However, that's when i noticed the resulting code gets into the
region of ~ 2 KB (even without the called library routines like
32-bit division/multiplication), and eventually threw away the
result again... :)

I'm only hesitant to bloat avr-libc for no reason, and i don't
want to bloat the API with stuff nobody's going to use, ever.  So
that was my basic question: i think we can agree that having a
function named random() that returns a long int (as opposed to
rand() returning an int) is a good idea.  So the only question is
which of the available functions to stuff behind random(), and if
we want to provide both, how to name the second one.

J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]