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

Classes

CryptoApi

Main class

BaseHasher
BaseEncode

Encode HashArray

Hashers

Collection of hashers

Encodes

Collection of encodes

Tools

Helper with some methods

HashArray

Array of hash bytes

HexBaseEncode

Hex encode

Md2BaseHasher

Md2 hasher

Md4BaseHasher

Md4 hasher

## Members
name : string

Hasher name

message : Array.<number>

Message

## HasherInterface **Kind**: global interface **Access:** public

hasherInterface.constructor

Kind: instance class of HasherInterface

HasherInterface.processBlock(block)

Process one block

Kind: static method of HasherInterface

Param Type
block Array.<number>

HasherInterface.finalize() ⇒ HashArray

Finalize hash computing

Kind: static method of HasherInterface

EncodeInterface

Kind: global interface
Access: public

encodeInterface.constructor

Kind: instance class of EncodeInterface

new EncodeInterface.prototype.constructor(hash)

Param Type
hash HashArray

EncodeInterface.stringify() ⇒ string

Stringify hash

Kind: static method of EncodeInterface

CryptoApi

Main class

Kind: global class
Access: public

CryptoApi.Hashers : Hashers

Kind: static property of CryptoApi

CryptoApi.Encodes : Encodes

Kind: static property of CryptoApi

CryptoApi.Tools : Tools

Kind: static property of CryptoApi

CryptoApi.BaseHasher : BaseHasher

Kind: static property of CryptoApi

CryptoApi.BaseEncode : BaseEncode

Kind: static property of CryptoApi

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) ⇒ BaseHasher

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>

BaseHasher

Kind: global class
Access: public

new BaseHasher(name, options)

Param Type
name string
options Object

BaseHasher.length : number

Length of message

Kind: static property of BaseHasher

BaseHasher.state : Object

All algorithm variables that changed during process

Kind: static property of BaseHasher

BaseHasher.unitSize : number

Size of unit in bytes (4 = 32 bits)

Kind: static property of BaseHasher

BaseHasher.unitOrder : number

Bytes order in unit 0 - normal 1 - reverse

Kind: static property of BaseHasher

BaseHasher.blockSize : number

Size of block in units

Kind: static property of BaseHasher

BaseHasher.processBlock(block)

Process ready block

Kind: static method of BaseHasher

Param Type
block Array.<number>

BaseHasher.finalize() ⇒ HashArray

Process last block and return hash

Kind: static method of BaseHasher
Returns: HashArray - hash

BaseHasher.getState() ⇒ Object

Return current state

Kind: static method of BaseHasher

BaseHasher.setState(state) ⇒ BaseHasher

Set state

Kind: static method of BaseHasher

Param Type
state Object

BaseHasher.update(message) ⇒ BaseHasher

Update message

Kind: static method of BaseHasher

Param Type
message string | Array.<number>

BaseHasher.process()

Process ready blocks

Kind: static method of BaseHasher

BaseEncode

Encode HashArray

Kind: global class
Access: public

new BaseEncode(hash)

Param Type
hash HashArray

baseEncode.constructor

Kind: instance class of BaseEncode

new BaseEncode.prototype.constructor(hash)

Param Type
hash HashArray

constructor.hash : HashArray

Kind: instance property of constructor
Properties

Name
hash

Hashers

Collection of hashers

Kind: global class

Hashers.hashers : Object

Kind: static property of Hashers

Hashers.add(name, hasher)

Kind: static method of Hashers

Param Type
name string
hasher BaseHasher

Hashers.add(name, options) ⇒ HasherInterface

Kind: static method of Hashers

Param Type
name string
options Object

Encodes

Collection of encodes

Kind: global class

Encodes.add(name, encode)

Kind: static method of Encodes

Param Type
name string
encode BaseEncode

Encodes.get(name, hash) ⇒ BaseEncode

Kind: static method of Encodes

Param Type
name string
hash HashArray

Tools

Helper with some methods

Kind: global class

Tools.rotateLeft(x, n) ⇒ number

Rotate x to n bits left

Kind: static method of Tools

Param Type
x number
n number

Tools.rotateLeft(x, n) ⇒ number

Rotate x to n bits right

Kind: static method of Tools

Param Type
x number
n number

HashArray

Array of hash bytes

Kind: global class
Access: public
Instanceof: Array

new HashArray(hash, Encodes)

Param Type
hash Array.<number>
Encodes Encodes

Hex ⇐ BaseEncode

Hex encode

Kind: global class
Extends: BaseEncode
Implements: EncodeInterface

new Hex(hash)

Param Type
hash HashArray

hex.constructor

Kind: instance class of Hex
Implements: constructor

new BaseEncode.prototype.constructor(hash)

Param Type
hash HashArray

Hex.stringify() ⇒ string

Kind: static method of Hex

Md2 ⇐ BaseHasher

Md2 hasher

Kind: global class
Extends: BaseHasher
Implements: HasherInterface

md2.constructor

Kind: instance class of Md2
Implements: constructor

md2.piSubst : Array.<number>

Constants from Pi

Kind: instance property of Md2
Link: https://github.com/e-sushi/MD2-S-box-creator

md2.unitSize : number

Size of unit = 1 byte

Kind: instance property of Md2

Md2.state.hash : Array.<number>

Hash state

Kind: static property of Md2

Md2.state.checksum : Array.<number>

Checksum

Kind: static property of Md2

Md2.processBlock(block)

Kind: static method of Md2

Param Type
block Array.<number>

Md2.finalize() ⇒ HashArray

Kind: static method of Md2

Md4 ⇐ BaseHasher

Md4 hasher

Kind: global class
Extends: BaseHasher

Md4.state : Object

Kind: static property of Md4

state.hash : Array.<number>

Hash state

Kind: static property of state

Md4.S : Array.<number>

Transform constants

Kind: static constant of Md4

name : string

Hasher name

Kind: global variable

message : Array.<number>

Message

Kind: global variable

Clone this wiki locally