Object built-in object

Object Digest

Information summary object

Inheritance

Member attributes

size

Integer, query the number of digest bytes of the current information digest algorithm

1
readonly Integer Digest.size;

Member function

update

Update binary summary information

1
Digest Digest.update(Buffer data);

Call parameters:

  • data : Buffer , binary data block

Return result:

  • Digest , returns the information digest object itself

digest

Calculate and return summary

1
Value Digest.digest(String codec = "buffer");

Call parameters:

  • codec : String, specify the encoding format, allowed values ​​are: "buffer", " hex ", " base64 ", "utf8", or the character set supported by the system

Return result:

  • Value , returns the summary representation of the specified encoding

toString

Returns the string representation of the object, generally returns "[Native Object]", the object can be re-implemented according to its own characteristics

1
String 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

1
Value Digest.toJSON(String key = "");

Call parameters:

  • key : String, unused

Return result:

  • Value , returns a value containing JSON serializable