Javascript Engine

From Yate Documentation
(Difference between revisions)
Jump to: navigation, search
(Methods)
Line 2: Line 2:
 
This object is frozen.
 
This object is frozen.
  
== Methods ==
+
== Static methods ==
  
* atob
+
* '''output()'''
 +
* '''debug()'''
 +
* '''alarm()'''
 +
* '''sleep()'''
 +
* '''usleep()'''
 +
* '''yield()'''
 +
* '''idle()'''
 +
* '''restart()'''
 +
* '''dump_r()'''
 +
* '''print_r()'''
 +
* '''dump_t()'''
 +
* '''print_t()'''
 +
* '''debugName()'''
 +
* '''debugLevel()'''
 +
* '''debugEnabled()'''
 +
* '''debugAt()'''
 +
* '''setDebug()'''
 +
* '''started()'''
 +
* '''runParams()'''
 +
* '''configFile()'''
 +
* '''setInterval()'''
 +
* '''clearInterval()'''
 +
* '''setTimeout()'''
 +
* '''clearTimeout()'''
 +
* '''loadLibrary()'''
 +
* '''loadObject()'''
 +
* '''replaceParams()'''
 +
 
 +
* '''atob'''
 
Decode Base64 data.<br>
 
Decode Base64 data.<br>
 
Parameters:<br>
 
Parameters:<br>
Line 12: Line 40:
 
  str = Engine.atob(b64_str)
 
  str = Engine.atob(b64_str)
  
* btoa
+
* '''btoa'''
 
Encode string data to Base64.<br>
 
Encode string data to Base64.<br>
 
Parameters:<br>
 
Parameters:<br>
Line 22: Line 50:
 
  b64_str = Engine.btoa(str[,line_len[,add_eol]])
 
  b64_str = Engine.btoa(str[,line_len[,add_eol]])
  
* atoh
+
* '''atoh'''
 
Decode Base64 data.<br>
 
Decode Base64 data.<br>
 
Parameters:<br>
 
Parameters:<br>
Line 32: Line 60:
 
  hex_str = Engine.atoh(b64_str[,hex_sep[,hex_upcase]])
 
  hex_str = Engine.atoh(b64_str[,hex_sep[,hex_upcase]])
  
* htoa
+
* '''htoa'''
 
Encode hexified binary (string) data to Base64.<br>
 
Encode hexified binary (string) data to Base64.<br>
 
Parameters:<br>
 
Parameters:<br>
Line 42: Line 70:
 
  b64_str = Engine.htob(hex_str[,line_len[,add_eol]])
 
  b64_str = Engine.htob(hex_str[,line_len[,add_eol]])
  
* btoh
+
* '''btoh'''
 
Convert binary (string) data to hexified string.<br>
 
Convert binary (string) data to hexified string.<br>
 
Parameters:<br>
 
Parameters:<br>
Line 52: Line 80:
 
  hex_str = Engine.btoh(str[,hex_sep[,hex_upcase]])
 
  hex_str = Engine.btoh(str[,hex_sep[,hex_upcase]])
  
* htob
+
* '''htob'''
 
Unhexify binary (string) data.<br>
 
Unhexify binary (string) data.<br>
 
Parameters:<br>
 
Parameters:<br>

Revision as of 15:06, 7 March 2016

Javascript static Engine object.
This object is frozen.

Static methods

  • output()
  • debug()
  • alarm()
  • sleep()
  • usleep()
  • yield()
  • idle()
  • restart()
  • dump_r()
  • print_r()
  • dump_t()
  • print_t()
  • debugName()
  • debugLevel()
  • debugEnabled()
  • debugAt()
  • setDebug()
  • started()
  • runParams()
  • configFile()
  • setInterval()
  • clearInterval()
  • setTimeout()
  • clearTimeout()
  • loadLibrary()
  • loadObject()
  • replaceParams()
  • atob

Decode Base64 data.
Parameters:
b64_str: Mandatory, Base64 encoded data
Return:
Decoded data, boolean false on failure (invalid Base64 data)

str = Engine.atob(b64_str)
  • btoa

Encode string data to Base64.
Parameters:
str: Mandatory, data to encode
line_len: Optional line length (split encoded data, add end of line after each line_len chars)
add_eol: Optional, add an extra end of line after encoded data
Return:
Base64 encoded data

b64_str = Engine.btoa(str[,line_len[,add_eol]])
  • atoh

Decode Base64 data.
Parameters:
b64_str: Mandatory, Base64 encoded data
hex_sep: Optional separator to use between octets. Set it to 'undefined' if not used and hex_upcase is given
hex_upcase: Optional, use upper case characters in hexa
Return:
Hexified string, boolean false on failure (invalid Base64 data)

hex_str = Engine.atoh(b64_str[,hex_sep[,hex_upcase]])
  • htoa

Encode hexified binary (string) data to Base64.
Parameters:
hex_str: Mandatory, data to encode
line_len: Optional line length (split encoded data, add end of line after each line_len chars)
add_eol: Optional, add an extra end of line after encoded data
Return:
The string, boolean false on failure (invalid input string).

b64_str = Engine.htob(hex_str[,line_len[,add_eol]])
  • btoh

Convert binary (string) data to hexified string.
Parameters:
str: Mandatory, data to hexify
hex_sep: Optional separator to use between octets. Set it to 'undefined' if not used and hex_upcase is given
hex_upcase: Optional, use upper case characters in hexa
Return:
Hexified string

hex_str = Engine.btoh(str[,hex_sep[,hex_upcase]])
  • htob

Unhexify binary (string) data.
Parameters:
hex_str: Mandatory, data to unhexify
hex_sep: Optional separator between octets. Set it to 'undefined' if missing or unknown (autodetect)
Return:
The string, boolean false on failure (invalid input string).

str = Engine.htob(hex_str[,hex_sep])

Properties

Personal tools
Namespaces

Variants
Actions
Preface
Configuration
Administrators
Developers