Class: SigCache

script~SigCache(sizeopt)

Signature cache.

Constructor

new SigCache(sizeopt)

Create a signature cache.

Parameters:
Name Type Attributes Default Description
size Number <optional>
10000
Properties:
Name Type Description
size Number
keys Array.<Hash>
valid Object
Source:

Methods

add(msg, sig, key)

Add item to the sigcache. Potentially evict a random member.

Parameters:
Name Type Description
msg Hash

Sig hash.

sig Buffer
key Buffer
Source:

has(msg, sig, key) → {Boolean}

Test whether the sig exists.

Parameters:
Name Type Description
msg Hash

Sig hash.

sig Buffer
key Buffer
Source:
Returns:
Type
Boolean

resize(size)

Resize the sigcache.

Parameters:
Name Type Description
size Number
Source:

verify(msg, sig, key) → {Boolean}

Verify a signature, testing it against the cache first.

Parameters:
Name Type Description
msg Buffer
sig Buffer
key Buffer
Source:
Returns:
Type
Boolean