On Thu, May 28, 2015 at 08:18:14PM -0700, chi wrote:
Also, a number-u8vector function would be nice. Converting a number to a hex
string, then taking every 2 characters of that and converting that back to a
number, for each element of the u8vector, just to keep me from accessing the
number's
chi scripsit:
Ironically, that is exactly what the SRFI-27 module implements.
http://wiki.call-cc.org/eggref/4/srfi-27#random-sources
Could make an insecure random source, or even a totally non-random random
source I imagine.
I had no idea it was so comprehensively extended.
--
John Cowan
On Thu, May 28, 2015 at 9:09 PM, John Cowan co...@mercury.ccil.org wrote:
Peter Bex scripsit:
If this is such an important feature it may make more sense to include
a proper PRNG.
Different applications will want fast crude random-ish numbers, PRNGs,
cryptographic PRNGs, or full quantum
(define (bignum-u8vector/host-byte-order num)
(unless (bignum? num) (error Argument is not a bignum! num))
(let* ((word-size (cond-expand (64bit 8) (else 4))) ; Is there a better way?
(bignum-contents (##sys#slot num 1)) ; Digits preceded by sign word
(bignum-digits
On Thu, May 28, 2015 at 8:59 AM, Peter Bex pe...@more-magic.net wrote:
Yeah, the numbers random implementation is shitty, which is why I
decided to omit it from my port to CHICKEN core (CHICKEN 5's random is
still fixnum only). Personally, I think it would be better if we simply
got rid of
On Thu, May 28, 2015 at 10:34:55PM +0200, Michele La Monaca wrote:
On Thu, May 28, 2015 at 8:59 AM, Peter Bex pe...@more-magic.net wrote:
Yeah, the numbers random implementation is shitty, which is why I
decided to omit it from my port to CHICKEN core (CHICKEN 5's random is
still fixnum
On Thu, May 28, 2015 at 11:23 PM, Peter Bex pe...@more-magic.net wrote:
On Thu, May 28, 2015 at 10:34:55PM +0200, Michele La Monaca wrote:
On Thu, May 28, 2015 at 8:59 AM, Peter Bex pe...@more-magic.net wrote:
Yeah, the numbers random implementation is shitty, which is why I
decided to omit
On May 27, 2015, at 3:53 PM, chi chic...@verge.info.tm wrote:
How would I convert a u8vector to a bignum?
I'd like a good large random number, and there's srfi 27 for decent random
sources, and there's 'numbers' for bignum support, but srfi-27 only produces
fixnums or u8vectors.
The
On Thu, May 28, 2015 at 3:59 PM, Peter Bex pe...@more-magic.net wrote:
Yeah, the numbers random implementation is shitty, which is why I
decided to omit it from my port to CHICKEN core (CHICKEN 5's random is
still fixnum only).
This is surprisingly hard to do well - the Chibi SRFI-27
On 05/28/2015 05:09 PM, John Cowan wrote:
Different applications will want fast crude random-ish numbers, PRNGs,
cryptographic PRNGs, or full quantum randomness, with tradeoffs for
speed and quality.
Ironically, that is exactly what the SRFI-27 module implements.
On 05/28/2015 12:55 PM, Kon Lovett wrote:
The integer result range extends to that of the limit parameter. Ex:
Yeah sorry, I didn't see that the first time, my bad.
(random-integer large-bignum) would produce a large bignum just fine. Problem
solved!
But did you take a look at the
Also, a number-u8vector function would be nice. Converting a number to a hex
string, then taking every 2 characters of that and converting that back to a
number, for each element of the u8vector, just to keep me from accessing the
number's bytes directly, just strikes me as terribly roundabout.
Peter Bex scripsit:
If this is such an important feature it may make more sense to include
a proper PRNG.
Different applications will want fast crude random-ish numbers, PRNGs,
cryptographic PRNGs, or full quantum randomness, with tradeoffs for
speed and quality. Since that's so, I'd rather
On Wed, May 27, 2015 at 03:53:39PM -0700, chi wrote:
How would I convert a u8vector to a bignum?
I'd like a good large random number, and there's srfi 27 for decent random
sources, and there's 'numbers' for bignum support, but srfi-27 only produces
fixnums or u8vectors.
I don't know
Personally, I think it would be better if we simply
got rid of all random support in core, because there's no way this is
ever
going to satisfy everyone. Besides, the standard C library functions are
deeply flawed, especially on some platforms like OS X.
Emphatic +1.
--
John Cowan
How would I convert a u8vector to a bignum?
I'd like a good large random number, and there's srfi 27 for decent random
sources, and there's 'numbers' for bignum support, but srfi-27 only produces
fixnums or u8vectors. Logically I can't imagine a bignum isn't represented under
the hood by a block
16 matches
Mail list logo