--- a/UUID.st Sat Aug 10 17:32:19 2019 +0200
+++ b/UUID.st Sun Aug 11 23:50:14 2019 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
"
COPYRIGHT (c) 2002 by eXept Software AG
All Rights Reserved
@@ -803,9 +805,12 @@
"/ bitXor:(self computeXorHashFrom:13 to:16)
"
- |allHashes|
- allHashes := UUID allInstances collect:[:each| each hash].
- (allHashes asSet size / allHashes size) asFloat
+ |allHashes nonConflictsRatio|
+
+ allHashes := UUID allInstances collect:[:each| each hash].
+ Transcript showCR:'collisions: %1 (in %2 UUIDs)' with:(allHashes size - allHashes asSet size) with:allHashes size.
+ nonConflictsRatio := (allHashes asSet size / allHashes size) asFloat asFixedPoint:2.
+ Transcript showCR:'%1%% collision rate' with:(1 asFixedPoint - nonConflictsRatio)*100
"
! !