Added toHex(uint).
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4199 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -16,6 +16,15 @@ public class Util
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
public static function toHex (value :uint) :String
|
||||
{
|
||||
var buf :StringBuilder = new StringBuilder("0x");
|
||||
for (var ii :int = 7; ii >= 0; ii--) {
|
||||
buf.append(HEX[(value >> (ii * 4)) & 0xF]);
|
||||
}
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
public static function cast (obj :Object, clazz :Class) :Object
|
||||
{
|
||||
if (obj == null || obj is clazz) {
|
||||
|
||||
Reference in New Issue
Block a user