Class M.Cypher
Extends
M.Object.
M.Cypher defines a prototype for handling decoding, encoding and hashing of string
based values.
Defined in: cypher.js.
Constructor Attributes | Constructor Name and Description |
---|---|
M.Cypher()
|
Field Attributes | Field Name and Description |
---|---|
The default decoder.
|
|
The default encoder.
|
|
The default hash algorithm.
|
|
The type of this object.
|
Method Attributes | Method Name and Description |
---|---|
decode(input, algorithm)
This method is the one that initiates the decoding of a given string, based on either
the default decoder or a custom decoder.
|
|
encode(input, algorithm)
This method is the one that initiates the encoding of a given string, based on either
the default encoder or a custom encoder.
|
|
hash(input, algorithm)
This method is the one that initiates the hashing of a given string, based on either
the default hashing algorithm or a custom hashing algorithm.
|
Field Detail
{M.Base64}
defaultDecoder
The default decoder.
{M.Base64}
defaultEncoder
The default encoder.
{M.SHA256}
defaultHasher
The default hash algorithm.
{String}
type
The type of this object.
Method Detail
{String}
decode(input, algorithm)
This method is the one that initiates the decoding of a given string, based on either
the default decoder or a custom decoder.
- Parameters:
- {String} input
- The input string to be decoded.
- {Object} algorithm
- The algorithm object containing a decode method.
- Returns:
- {String} The decoded string.
{String}
encode(input, algorithm)
This method is the one that initiates the encoding of a given string, based on either
the default encoder or a custom encoder.
- Parameters:
- {String} input
- The input string to be decoded.
- {Object} algorithm
- The algorithm object containing a encode method.
- Returns:
- {String} The encoded string.
{String}
hash(input, algorithm)
This method is the one that initiates the hashing of a given string, based on either
the default hashing algorithm or a custom hashing algorithm.
- Parameters:
- {String} input
- The input string to be hashed.
- {Object} algorithm
- The algorithm object containing a hash method.
- Returns:
- {String} The hashed string.