# Titanium.Utils
The top-level Utils module, containing a set of JavaScript methods that are often useful when building applications.
# Methods
# base64decode
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
- Type
- Titanium.Blob
# base64encode
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
- Type
- Titanium.Blob
# md5HexDigest
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
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
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