class: Random
authorStefan Vogel <sv@exept.de>
Thu, 02 Oct 2014 19:56:20 +0200
changeset 3431 4ece2027bd33
parent 3430 9f50ed777fd0
child 3432 751e3349dd98
class: Random changed: #randomSeed
Random.st
--- 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 $'
 ! !