kadence/contentaddress~ ContentAddressPlugin

Enforces that any KademliaNode~entry stored in the DHT must be content-addressable (keyed by the hash of it's value).

Constructor

new ContentAddressPlugin(node, optionsopt)

Parameters:
NameTypeAttributesDescription
nodeAbstractNode
optionsobject<optional>
Properties
NameTypeAttributesDefaultDescription
keyAlgorithmstring<optional>
"rmd160"

Algorithm for hashing

valueEncodingstring<optional>
"base64"

Text encoding of value

Methods

validate(request, response, next)

Validate the the key matches the hash of the value

Parameters:
NameTypeDescription
requestAbstractNode~request
responseAbstractNode~response
nextAbstractNode~next