diff --git a/src/as/com/threerings/util/StringUtil.as b/src/as/com/threerings/util/StringUtil.as index 0caa0f81c..0f81790c3 100644 --- a/src/as/com/threerings/util/StringUtil.as +++ b/src/as/com/threerings/util/StringUtil.as @@ -170,6 +170,18 @@ public class StringUtil return array; } + /** + * Return a hex string representation of the specified value. + */ + public static function toHexString (value :uint) :String + { + var str :String = ""; + for (var x :int = 0; x < 8; x++) { + str = HEX[(value >> (x * 4)) & 0xF] + str; + } + return "0x" + str; + } + /** * Generates a string from the supplied bytes that is the hex encoded * representation of those byts. Returns the empty String for a