Branch: Tag:

1999-06-16

1999-06-16 23:24:53 by David Hedbor <david@hedbor.org>

Memory and speed optimized pike_random->read

Rev: lib/modules/Crypto/randomness.pmod:1.9

70:   class pike_random {    string read(int len)    { -  return sprintf("%@c", Array.map(allocate(len), lambda(int dummy) -  { -  return random(256); -  } )); +  if (len > 16384) return read(len/2)+read(len-len/2); +  return (string)allocate(len, random)(256);    }   }