Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter FiveGeneral Functions (continued)

MD5CreateDigest Function

Overview

The MD5CreateDigest function will generate an MD5 digest for a string, a buffer, or a file object.

Syntax/Parameters

Syntax

string = MD5CreateDigest ( handle file | string buffer, [int size] );

Parameters

handle

A handle created by the OpenFile or CreateFile functions. Note that the file position is not preserved.

buffer

A string or char buffer from which the digest will be created. If a string is supplied, it is assumed to be zero-terminated unless size is specified.

size

An optional int specifying a size of the input buffer. For strings, if size is omitted, the function runs the length of the string, For buffers, size must be at or less than the allocated size of the buffer.

Return Value

Returns a string containing a hexadecimal representation of a 16 byte MD5 hash or an empty string on failure. Use the GetLastError function to retrieve error information.

Remarks

The hex output is in lower case but can be converted to upper case using the MakeUpperCase function.

Example:

string = MD5CreateDigest("The quick brown fox jumps over the lazy dog");

yields the string:

9e107d9d372bb6826bd81d3542a419d6

The resulting string can be further formatted as required.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic