dreamworkAPI
Ctrl K
GitHub
classDocs / crypto / MD5

crypto.MD5

classsharedmenusource
Object → crypto.MD5

MD5 object.

Constructor

crypto.MD5(): crypto.MD5

Fields

NameTypeDescription
digest_sizeinteger = 16
block_sizeinteger = 64
digestfun( message: string, as_hex: boolean? ): string

Operators

OperatorOperandResult
callcrypto.MD5

Static functions

#crypto.MD5.digest

sharedmenunodiscardsource
function crypto.MD5.digest(message: string, as_hex?: boolean): string

Computes the MD5 digest of the given input string.

This static method takes a string and returns its MD5 hash as a hexadecimal string. Commonly used for checksums, data integrity validation, and password hashing.

Parameters
NameTypeDescription
messagestringThe message to compute MD5 for.
as_hexoptionalbooleanIf true, the result will be a hex string.
Returns
TypeNameDescription
stringstr_resultThe MD5 string of the message.

Methods

digestCalculates the MD5 digest based on the current state or input of the object.
resetResets the MD5 object to its initial state.
updateUpdates the MD5 object with the given string.

#MD5:digest

sharedmenunodiscardsource
function crypto.MD5:digest(as_hex?: boolean): string

Calculates the MD5 digest based on the current state or input of the object.

This instance method returns the MD5 hash of the data associated with the object. Useful when the MD5 object has been incrementally updated with input data.

Does not change the state, so the object can be updated further.

Parameters
NameTypeDescription
as_hexoptionalbooleanIf true, the result will be a hex string.
Returns
TypeNameDescription
stringstr_resultThe MD5 string of the message.

#MD5:reset

sharedmenusource
function crypto.MD5:reset(): crypto.MD5

Resets the MD5 object to its initial state.

This instance method resets the MD5 object to its initial state.

It returns the MD5 object for method chaining.

Returns
TypeNameDescription
crypto.MD5objThe reset MD5 object.

#MD5:update

sharedmenusource
function crypto.MD5:update(str: string): crypto.MD5

Updates the MD5 object with the given string.

This instance method updates the MD5 object with the given string.

It returns the MD5 object for method chaining.

Parameters
NameTypeDescription
strstringThe string to update the MD5 object with.
Returns
TypeNameDescription
crypto.MD5objThe updated MD5 object.
Generated from the dreamwork meta branch.