Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
dalehenrich committed Dec 11, 2014
2 parents c0f1477 + 09d543a commit 859cd29
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
17 changes: 17 additions & 0 deletions repository/Core.package/UUID.class/instance/asString36.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
converting
asString36
"Encode the UUID as a base 36 string using 0-9 and lowercase a-z.
This is the shortest representation still being able to work as
filenames etc since it does not depend on case nor characters
that might cause problems, and it fits into short filenames like on
the old MacOS HFS filesystem. The check for 36r is to make this code
work in versions before Squeak 3.8."

| num candidate |
num := 0.
1 to: self size do: [:i | num := num + ((256 raisedTo: i - 1) * (self at: i))].
candidate := num printStringBase: 36.
^((candidate beginsWith: '36r')
ifTrue: [candidate copyFrom: 4 to: candidate size]
ifFalse: [candidate]) asLowercase

1 change: 1 addition & 0 deletions repository/Core.package/UUID.class/methodProperties.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
">" : "sig 01/03/2009 12:09",
">=" : "sig 01/03/2009 12:10",
"asString" : "dkh 06/05/2007 21:30",
"asString36" : "JohanBrichau 06/22/2013 09:25",
"asUUID:" : "dkh 06/05/2007 21:30",
"printHexAt:to:" : "dkh 06/05/2007 21:30",
"printOn:" : "dkh 06/05/2007 21:30",
Expand Down
Loading

0 comments on commit 859cd29

Please sign in to comment.