The RPCUIDUtil class is a copy of UIDUtil without some functions that cause dependency problems when RPC messages are put in a bootstrap loader.

Static methods

staticcreateUID():String

Generates a UID (unique identifier) based on ActionScript's pseudo-random number generator and the current time.

The UID has the form "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" where X is a hexadecimal digit (0-9, A-F).

This UID will not be truly globally unique; but it is the best we can do without player support for UID generation.

Returns:

The newly-generated UID.

staticfromByteArray(ba:ByteArray):String

Converts a 128-bit UID encoded as a ByteArray to a String representation. The format matches that generated by createUID. If a suitable ByteArray is not provided, null is returned.

Parameters:

ba

ByteArray 16 bytes in length representing a 128-bit UID.

Returns:

String representation of the UID, or null if an invalid ByteArray is provided.

staticisUID(uid:String):Bool

A utility method to check whether a String value represents a correctly formatted UID value. UID values are expected to be in the format generated by createUID(), implying that only capitalized A-F characters in addition to 0-9 digits are supported.

Parameters:

uid

The value to test whether it is formatted as a UID.

Returns:

Returns true if the value is formatted as a UID.

statictoByteArray(uid:String):ByteArray

Converts a UID formatted String to a ByteArray. The UID must be in the format generated by createUID, otherwise null is returned.

Parameters:

String

representing a 128-bit UID

Returns:

ByteArray 16 bytes in length representing the 128-bits of the UID or null if the uid could not be converted.