'From Squeak3.7alpha of ''11 September 2003'' [latest update: #5657] on 8 February 2004 at 12:55:22 pm'! "Change Set: UUID-printing-ar Date: 6 February 2004 Author: Andreas Raab v2: move printString to printing category and not *tweak... sd For serializing UUIDs the existing method for converting it into a string was very slow. The new method speeds it up by a factor of ten. (added missing method timestamps -dew)"! !UUID methodsFor: 'converting' stamp: 'ar 2/8/2004 12:16'! asString | result data | data _ String new: 36. result _ WriteStream on: data. 1 to: 4 do:[:i| self printHexAt: i to: result]. result nextPut: $-. 5 to: 6 do:[:i| self printHexAt: i to: result]. result nextPut: $-. 7 to: 8 do:[:i| self printHexAt: i to: result]. result nextPut: $-. 9 to: 10 do:[:i| self printHexAt: i to: result]. result nextPut: $-. 11 to: 16 do:[:i| self printHexAt: i to: result]. ^data. ! ! !UUID methodsFor: 'converting' stamp: 'ar 2/8/2004 12:16'! printHexAt: index to: aStream | map v | map := '0123456789abcdef'. v := self at: index. aStream nextPut: (map at: (v bitShift: -4) + 1). aStream nextPut: (map at: (v bitAnd: 15) + 1). ! ! !UUID methodsFor: 'printing' stamp: 'ar 2/8/2004 12:16'! printString ^self asString! !