WARNING: byte order of internal byte-representation changed;
authorClaus Gittinger <cg@exept.de>
Mon, 20 Feb 2006 13:53:54 +0100
changeset 1601 b0dfbe332caf
parent 1600 f3acd5382fa1
child 1602 6ffbb8db78a4
WARNING: byte order of internal byte-representation changed; this affects only those who care for the internal bytes (or create UUID's from a byteArray)
UUID.st
--- a/UUID.st	Wed Feb 15 14:52:13 2006 +0100
+++ b/UUID.st	Mon Feb 20 13:53:54 2006 +0100
@@ -157,7 +157,7 @@
 
         s next.
 
-        1 to:3 do:[:i |
+        1 to:2 do:[:i |
             t := s next:4.
             d := Integer readFrom:t radix:16 onError:[^ errorBlock value].
             uuid unsignedShortAt:offs put:d bigEndian:false.
@@ -165,6 +165,12 @@
             s next.
         ].
 
+        t := s next:4.
+        d := Integer readFrom:t radix:16 onError:[^ errorBlock value].
+        uuid unsignedShortAt:offs put:d bigEndian:true.
+        offs := offs + 2.
+        s next.
+
         1 to:6 do:[:i |
             t := s next:2.
             byte := Integer readFrom:t radix:16 onError:[^ errorBlock value].
@@ -176,7 +182,8 @@
 
     "
      UUID readFrom:'5ab2e9b4-3d48-11d2-9ea4-80c5140aaa77' 
-     UUID fromString:'5ab2e9b4-3d48-11d2-9ea4-80c5140aaa77' 
+     UUID fromString:'5ab2e9b4-3d48-11d2-9ea4-80c5140aaa77'
+     UUID fromString:'00000001-0000-0000-C000-000000000046'
     "
 ! !
 
@@ -353,12 +360,16 @@
     tmpStream nextPut:$-.
 
     offs := 5.
-    3 timesRepeat:[
+    2 timesRepeat:[
         d := self unsignedShortAt:offs bigEndian:false.
         offs := offs + 2.
         d printOn:tmpStream base:16 size:4 fill:$0.
         tmpStream nextPut:$-.
     ].
+    d := self unsignedShortAt:offs bigEndian:true.
+    offs := offs + 2.
+    d printOn:tmpStream base:16 size:4 fill:$0.
+    tmpStream nextPut:$-.
 
     6 timesRepeat:[
         d := self at:offs.
@@ -372,7 +383,7 @@
 !UUID class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic2/UUID.st,v 1.14 2005-11-08 11:18:48 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/UUID.st,v 1.15 2006-02-20 12:53:54 cg Exp $'
 ! !
 
 UUID initialize!