misc is a namespace which provides various kinds of methods related to miscellaneous functionality. misc includes log, map and base64 classes and functionalities. Also, misc includes caph.miscTime which is explained in the caph.misc.Time page. Using misc.log method, a user can display a message to a console log. Also, using misc.Map class, a user can build a key value pair map. Also, using misc.encodeBase64 method, a user can encode a binary data into a base64 encoded string. Also, using misc.decodeBase64 method, a user can decode a base64 encoded string into a binary data.
log | ||
Description | ||
Displays the log message for debugging. | ||
Parameters | ■msg - String - message to log ■level (Optional) - Number - Log level | |
Return | ■Void | |
Emulator Support | Y | |
SDK Constraint | none | |
Example | ||
caph.misc.log('Error Message'); |
encodeBase64 | ||
Description | ||
Converts binary data into base64 encoded ASCII data | ||
Parameters | ■input - String - The input to be encoded | |
Return | ■String - ASCII | |
Emulator Support | Y | |
SDK Constraint | none | |
Example | ||
function foo(binaryData) { var str = caph.misc.encodeBase64(binaryData); doSomething(str); } |
decodeBase64 | ||
Description | ||
Converts ASCII data into base64 decoded binary data | ||
Parameters | ■input - String - The input to be encoded | |
Return | ■String - Binary | |
Emulator Support | Y | |
SDK Constraint | none | |
Example | ||
function foo(str) { var binaryData = caph.misc.decodeBase64(str); doSomething(binaryData); } |
Map | ||
Description | ||
Implements the function of Map | ||
Parameters | ■Void | |
Return | ■Object - the map that contains key value pairs | |
Emulator Support | Y | |
SDK Constraint | none | |
Example | ||
var map = new caph.misc.Map(); doSomething(map); |