# Titanium.Utils

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

Availability
0.9
0.9
9.2.0
4.1.0

# Methods

# base64decode

Availability
0.9
0.9
9.2.0
4.1.0
base64decode(obj) Titanium.Blob

Returns the specified data decoded from Base64.

The parameter can be a String, Ti.Blob or Ti.File (iOS since 7.0.2 and Android since 3.3.0).

Parameters

Name Type Description
obj String | Titanium.Blob | Titanium.Filesystem.File

Data to decode.

Returns


# base64encode

Availability
0.9
0.9
9.2.0
4.1.0
base64encode(obj) Titanium.Blob

Returns the specified data encoded to Base64.

The parameter can be a String, Ti.Blob or Ti.File (iOS since 7.0.2 and Android since 3.3.0).

Parameters

Name Type Description
obj String | Titanium.Blob | Titanium.Filesystem.File

Data to encode.

Returns


# md5HexDigest

Availability
0.9
0.9
9.2.0
4.1.0
md5HexDigest(obj) String

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

Parameters

Name Type Description
obj String | Titanium.Blob

Data to calculate.

Returns

Type
String

# sha1

Availability
1.3.2
1.3.2
9.2.0
4.1.0
sha1(obj) String

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

Parameters

Name Type Description
obj String | Titanium.Blob

Data to calculate.

Returns

Type
String

# sha256

Availability
1.8.0
1.8.0
9.2.0
4.1.0
sha256(obj) String

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

Parameters

Name Type Description
obj String | Titanium.Blob

Data to calculate.

Returns

Type
String