[Mono-list] GemBox.Spreadsheet 2.9 supporting Mono

Sebastien Pouliot sebastien.pouliot at gmail.com
Mon Sep 10 13:39:07 EDT 2007


My understanding is that the issue is solved but here's my two cents
anyway...

Using SHA1 is *heavyweight* (CPU) for the job of getting "regular"
randomness. A lot of faster algorithms are available to do so. E.g. You
could copy Mono's Random implementation (MIT licensed) and execute it
under any runtime (MS included).

If you need more than "regular" (which I doubt in your case) while still
keeping a replicable stream then using a HMAC (like HMAC-SHA1) would be
more suited for the task (than SHA1 alone).

Sebastien

On Mon, 2007-09-10 at 18:25 +0100, Alan McGovern wrote:
> If you need the same numbers for a given seed, why are you using a
> random number generator? If you need reproducible pseudo-random
> numbers then you could just SHA1 has your seed, which gives you 20
> bytes (4 integers). Then if you need more numbers, SHA1 hash the
> result from the previous operation to get a new set of 20 bytes (4
> integers) and keep going until you have all the numbers you need. This
> is guaranteed to produce the same psuedo-random numbers on every
> platform every time. 
> 
> Alan.
> 
> On 9/10/07, Miguel de Icaza <miguel at novell.com> wrote:
>         Hello,
>         
>         > After customer request, we have modified our .NET component
>         to work with
>         > Mono. To do so few minor changes were required and full
>         rewrite of Random
>         > methods (since .NET Framework and Mono return different
>         random values for 
>         > the same seed).
>         
>         This seems like an odd dependency to have (depending on the
>         random
>         number generator to have the same values).
>         
>         Is there a reason for that?
>         
>         Miguel
>         _______________________________________________ 
>         Mono-list maillist  -  Mono-list at lists.ximian.com
>         http://lists.ximian.com/mailman/listinfo/mono-list
> 
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list



More information about the Mono-list mailing list