Object Digest
Information summary object
Inheritance
Member attributes
size
Integer, query the number of digest bytes of the current information digest algorithm
1readonly Integer Digest.size;
Member function
update
Update binary summary information
1Digest Digest.update(Buffer data);
Call parameters:
- data: Buffer, Binary data block
Return result:
- Digest, Returns the information summary object itself
digest
Calculate and return summary
1Value Digest.digest(String codec = "buffer");
Call parameters:
- codec: String, specify the encoding format, allowed values are: "buffer", "hex", "base64", "utf8", or iconv Character set supported by the module
Return result:
- Value, Returns the summary representation of the specified encoding
sign
Sign and return summary
1Buffer Digest.sign(PKey key) async;
Call parameters:
- key: PKey, The signed private key
Return result:
- Buffer, Return the signed data
verify
Verify that the signatures are consistent
1
2Boolean Digest.verify(PKey key,
Buffer sign) async;
Call parameters:
- key: PKey, Verify the public key of the signature
- sign: Buffer, Specify the signature to be verified
Return result:
- Boolean, Return the verified result
toString
Returns the string representation of the object, generally returns "[Native Object]", the object can be re-implemented according to its own characteristics
1String Digest.toString();
Return result:
- String, Returns the string representation of the object
toJSON
Returns the JSON format representation of the object, generally returns a collection of readable attributes defined by the object
1Value Digest.toJSON(String key = "");
Call parameters:
- key: String, unused
Return result:
- Value, Returns a value containing JSON serializable