Skip to content
nf404 edited this page Dec 9, 2015 · 24 revisions

Classes

HasherInterface
EncodeInterface
HashArray

Array of hash bytes

CryptoApi

Main class

Md2

Md2 hasher

## HasherInterface **Kind**: global class

new HasherInterface(name, options)

Param Type
name string
options Object

HasherInterface.name : string

Hasher name

Kind: static property of HasherInterface

HasherInterface.message : Array.<number>

Message

Kind: static property of HasherInterface

HasherInterface.length : number

Length of message

Kind: static property of HasherInterface

HasherInterface.state : Object

All algorithm variables that changed during process

Kind: static property of HasherInterface

HasherInterface.unitSize : number

Size of unit in bytes (4 = 32 bits)

Kind: static property of HasherInterface

HasherInterface.unitOrder : number

Bytes order in unit 0 - normal 1 - reverse

Kind: static property of HasherInterface

HasherInterface.blockSize : number

Size of block in units

Kind: static property of HasherInterface

HasherInterface.processBlock(block)

Process ready block

Kind: static method of HasherInterface

Param Type
block Array.<number>

HasherInterface.finalize() ⇒ HashArray

Process last block and return hash

Kind: static method of HasherInterface
Returns: HashArray - hash

HasherInterface.getState() ⇒ Object

Return current state

Kind: static method of HasherInterface

HasherInterface.setState(state) ⇒ HasherInterface

Set state

Kind: static method of HasherInterface

Param Type
state Object

HasherInterface.update(message) ⇒ HasherInterface

Update message

Kind: static method of HasherInterface

Param Type
message string | Array.<number>

HasherInterface.process()

Process ready blocks

Kind: static method of HasherInterface

EncodeInterface

Kind: global class

new EncodeInterface(hash)

Encode HashArray

Param Type
hash Array.<number>

HashArray

Array of hash bytes

Kind: global class
Instanceof: Array

new HashArray(hash, Encodes)

Param Type
hash Array.<number>
Encodes Encodes

HashArray.stringify() ⇒ string

Stringify hash

Kind: static method of HashArray

CryptoApi

Main class

Kind: global class
Access: public

CryptoApi.HasherInterface

Kind: static property of CryptoApi
Instanceof: HasherInterface

CryptoApi.hash(algo, message, options) ⇒ HashArray

Hash message with algo

Kind: static method of CryptoApi
Returns: HashArray - hash
Access: public

Param Type
algo string
message string
options Object

CryptoApi.hasher(algo, options) ⇒ HasherInterface

Get new Hasher object

Kind: static method of CryptoApi
Access: public

Param Type
algo string
options Object

CryptoApi.hashArray(hash) ⇒ HashArray

Get new HashArray

Kind: static method of CryptoApi
Access: public

Param Type
hash Array.<number>

Md2

Md2 hasher

Kind: global class
Implements: HasherInterface

md2.processBlock()

Kind: instance method of Md2

md2.finalize()

Kind: instance method of Md2

Clone this wiki locally