Packagecom.google.analytics.core
Classpublic class Utils

Core utilities.



Public Methods
 MethodDefined by
  
[static] Generates a 32bit random number.
Utils
  
generateHash(input:String):int
[static] Generate hash for input string.
Utils
  
trim(raw:String, everything:Boolean = false):String
[static] This function takes a raw string, and removes all leading and trailing whitespaces (space, new line, CR, tab).
Utils
  
validateAccount(account:String):Boolean
[static] Checks if the paramater is a GA account ID.
Utils
Method detail
generate32bitRandom()method
public static function generate32bitRandom():int

Generates a 32bit random number.

Returns
int — 32bit random number.
generateHash()method 
public static function generateHash(input:String):int

Generate hash for input string. This is a global method, since it does not need to access any instance variables, and it is being used everywhere in the GATC module.

Parameters
input:String — Input string to generate hash value on.

Returns
int — Hash value of input string. If input string is undefined, or empty, return hash value of 1.
trim()method 
public static function trim(raw:String, everything:Boolean = false):String

This function takes a raw string, and removes all leading and trailing whitespaces (space, new line, CR, tab). If the inner option is true, trim also whitespaces within the string.

Parameters
raw:String
 
everything:Boolean (default = false)

Returns
String
validateAccount()method 
public static function validateAccount(account:String):Boolean

Checks if the paramater is a GA account ID.

Parameters
account:String

Returns
Boolean