Namespace: Lang

Lang

Lang Utility Class
Source:

Methods

(static) fromBytes(charsetopt) → {string}

Create a string from a bytes array
Parameters:
Name Type Attributes Description
Array.<byte> the string
charset string <optional>
the charset to use
Source:
Returns:
the byte array
Type
string

(static) guid() → {string}

Generates a random hex based guid
Source:
Returns:
the guid
Type
string

(static) isArray() → {boolean}

Check if the value in argument is an array
Parameters:
Type Description
Object the target array
Source:
Returns:
true if it's an array
Type
boolean

(static) isBoolean() → {boolean}

Check if the value in argument is a boolean
Parameters:
Type Description
Object the target object
Source:
Returns:
true if it's a boolean
Type
boolean

(static) isDate() → {boolean}

Check if the value in argument is a boolean
Parameters:
Type Description
Object the target object
Source:
Returns:
true if it's a boolean
Type
boolean

(static) isInteger() → {boolean}

Check if the value in argument is an integer
Parameters:
Type Description
Object the target object
Source:
Returns:
true if it's an integer
Type
boolean

(static) isNumber() → {boolean}

Check if the value in argument is a number
Parameters:
Type Description
Object the target object
Source:
Returns:
true if it's a number
Type
boolean

(static) isObject() → {boolean}

Check if the value in argument is an object
Parameters:
Type Description
Object the target object
Source:
Returns:
true if it's an object
Type
boolean

(static) isString() → {boolean}

Check if the value in argument is a string
Parameters:
Type Description
Object the target object
Source:
Returns:
true if it's an object
Type
boolean

(static) keys()

Create a key pair
Source:

(static) pin(lengthopt) → {integer}

Generates a random pin number of a specific length
Parameters:
Name Type Attributes Default Description
length integer <optional>
4 the length of the pin
Source:
Returns:
the pin
Type
integer

(static) rand(lengthopt) → {string}

Generates a random string of a specific length
Parameters:
Name Type Attributes Default Description
length integer <optional>
10 the length of the random string
Source:
Returns:
the random string
Type
string

(static) replace() → {string}

replace a portion of a string with a new one in the entire source string
Parameters:
Type Description
string the source sring
string the string to replace
string the new replacement string
Source:
Returns:
Type
string

(static) toBytes(charsetopt) → {Array.<byte>}

Get the bytes of a string
Parameters:
Name Type Attributes Description
string the string
charset string <optional>
the charset to use
Source:
Returns:
the byte array
Type
Array.<byte>

Lang

Lang Utility Class
Source:

Methods

(static) fromBytes(charsetopt) → {string}

Create a string from a bytes array
Parameters:
Name Type Attributes Description
Array.<byte> the string
charset string <optional>
the charset to use
Source:
Returns:
the byte array
Type
string

(static) guid() → {string}

Generates a random hex based guid
Source:
Returns:
the guid
Type
string

(static) isArray() → {boolean}

Check if the value in argument is an array
Parameters:
Type Description
Object the target array
Source:
Returns:
true if it's an array
Type
boolean

(static) isBoolean() → {boolean}

Check if the value in argument is a boolean
Parameters:
Type Description
Object the target object
Source:
Returns:
true if it's a boolean
Type
boolean

(static) isDate() → {boolean}

Check if the value in argument is a boolean
Parameters:
Type Description
Object the target object
Source:
Returns:
true if it's a boolean
Type
boolean

(static) isInteger() → {boolean}

Check if the value in argument is an integer
Parameters:
Type Description
Object the target object
Source:
Returns:
true if it's an integer
Type
boolean

(static) isNumber() → {boolean}

Check if the value in argument is a number
Parameters:
Type Description
Object the target object
Source:
Returns:
true if it's a number
Type
boolean

(static) isObject() → {boolean}

Check if the value in argument is an object
Parameters:
Type Description
Object the target object
Source:
Returns:
true if it's an object
Type
boolean

(static) isString() → {boolean}

Check if the value in argument is a string
Parameters:
Type Description
Object the target object
Source:
Returns:
true if it's an object
Type
boolean

(static) keys()

Create a key pair
Source:

(static) pin(lengthopt) → {integer}

Generates a random pin number of a specific length
Parameters:
Name Type Attributes Default Description
length integer <optional>
4 the length of the pin
Source:
Returns:
the pin
Type
integer

(static) rand(lengthopt) → {string}

Generates a random string of a specific length
Parameters:
Name Type Attributes Default Description
length integer <optional>
10 the length of the random string
Source:
Returns:
the random string
Type
string

(static) replace() → {string}

replace a portion of a string with a new one in the entire source string
Parameters:
Type Description
string the source sring
string the string to replace
string the new replacement string
Source:
Returns:
Type
string

(static) toBytes(charsetopt) → {Array.<byte>}

Get the bytes of a string
Parameters:
Name Type Attributes Description
string the string
charset string <optional>
the charset to use
Source:
Returns:
the byte array
Type
Array.<byte>