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(hash, sig, key)

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

Parameters:
Name Type Description
hash Hash

Sig hash.

sig Buffer
key Buffer
Source:

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

Test whether the sig exists.

Parameters:
Name Type Description
hash Hash

Sig hash.

sig Buffer
key Buffer
Source:
Returns:
Type
Boolean

resize(size)

Resize the sigcache.

Parameters:
Name Type Description
size Number
Source:

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

Verify a signature, testing it against the cache first.

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