--- a/Random.st Thu Oct 02 18:31:10 2014 +0200
+++ b/Random.st Thu Oct 02 19:56:20 2014 +0200
@@ -273,21 +273,22 @@
|hash|
- hash := MD5Stream new.
-
RandomSalt isNil ifTrue:[
RandomSalt := 1.
] ifFalse:[
RandomSalt := RandomSalt + 1.
].
- hash nextPut:RandomSalt.
- hash nextPutAll:Time microsecondClockValue asLargeInteger digitBytes.
- hash nextPutAll:OperatingSystem getProcessId asLargeInteger digitBytes.
- hash nextPutAll:(ObjectMemory addressOf:(Object new)) asLargeInteger digitBytes.
- hash nextPutAll:(ObjectMemory oldSpaceUsed) asLargeInteger digitBytes.
- hash nextPutAll:(ObjectMemory newSpaceUsed) asLargeInteger digitBytes.
+
+ hash := MD5Stream new.
+ hash
+ nextPut:RandomSalt;
+ nextPut:Time microsecondClockValue;
+ nextPut:OperatingSystem getProcessId;
+ nextPut:(ObjectMemory addressOf:Object new);
+ nextPut:ObjectMemory oldSpaceUsed;
+ nextPut:ObjectMemory newSpaceUsed.
[
- hash nextPutAll:(OperatingSystem getCPUCycleCount) asLargeInteger digitBytes.
+ hash nextPut:OperatingSystem getCPUCycleCount.
] on:PrimitiveFailure do:[].
"/ any other cheap sources of entropy?
@@ -757,10 +758,10 @@
!Random class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic2/Random.st,v 1.56 2014-10-02 15:36:18 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/Random.st,v 1.57 2014-10-02 17:56:20 stefan Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic2/Random.st,v 1.56 2014-10-02 15:36:18 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/Random.st,v 1.57 2014-10-02 17:56:20 stefan Exp $'
! !