Skip to content
Titanium SDK
Version12.6.2

You are reading 12.6.2. See this page in 13.4.1.

Titanium.Utils

moduleAndroidiPhoneiPadmacOSsince Android 0.9, iPhone 0.9, iPad 0.9, macOS 9.2.0

Extends Titanium.ModuleTitanium.Proxy

The top-level Utils module, containing a set of JavaScript methods that are often useful when building applications.

Properties 3

apiName

Stringsince Android 3.2.0, iPhone 3.2.0, iPad 3.2.0, macOS 9.2.0read-only

Inherited from Titanium.Proxy

The name of the API that this proxy corresponds to.

bubbleParent

Booleansince Android 3.0.0, iPhone 3.0.0, iPad 3.0.0, macOS 9.2.0

Inherited from Titanium.Proxy

Indicates if the proxy will bubble an event to its parent.

Default: true

Methods 9

Inherited from Titanium.Proxy

Adds the specified callback as an event listener for the named event.

Parameters
ParametersTypeDescription
nameString

Name of the event.

callbackCallback<Titanium.Event>

Callback function to invoke when the event is fired.

4 fields
bubbles Boolean

True if the event will try to bubble up if possible.

cancelBubble Boolean

Set to true to stop the event from bubbling.

source Object

Source object that fired the event.

type String

Name of the event fired.

Inherited from Titanium.Proxy

Fires a synthesized event to any registered listeners.

Parameters
ParametersTypeDescription
nameString

Name of the event.

event?Dictionary

A dictionary of keys and values to add to the Titanium.Event object sent to the listeners.

Returns a MD5 digest of the specified data as a hex-based String.

Parameters
ParametersTypeDescription
objString | Titanium.Blob

Data to calculate.

Returns String

Inherited from Titanium.Proxy

Removes the specified callback as an event listener for the named event.

Parameters
ParametersTypeDescription
nameString

Name of the event.

callbackCallback<Titanium.Event>

Callback function to remove. Must be the same function passed to addEventListener.

4 fields
bubbles Boolean

True if the event will try to bubble up if possible.

cancelBubble Boolean

Set to true to stop the event from bubbling.

source Object

Source object that fired the event.

type String

Name of the event fired.

sha1

since 1.3.2

Returns a SHA-1 hash of the specified data as a hex-based String.

Parameters
ParametersTypeDescription
objString | Titanium.Blob

Data to calculate.

Returns String

sha256

since 1.8.0

Returns a SHA-256 hash of the specified data as a hex-based String.

Parameters
ParametersTypeDescription
objString | Titanium.Blob

Data to calculate.

Returns String