Go to main content

md5file

Calculate the md5 hash of a file.

MD5FILE

NAME

md5file - Calculates the md5 hash of a file.

SYNOPSIS

md5file(string,error)

PARAMETERS

string
File path.
error
If you specified an error variable, then this variable will contain errcode and errmsg. If errcode is not 0, than there is an error. This does not trap error with parameters.

DESCRIPTION

This is a cryptographic hash injective function. It is used to transform a string into a 32-characters hexadecimal number.  This function calculates the message digest-5 of a string. It is a cryptographic hash function used to verify data integrity. A hash function is used to map digital data of some size to digital data with a fixed size. When cryptographic hash function is encountered, it is almost impossible to recreate the input data from the output data, the hash value. It produces a 128-bit hash value.

RETURN

ash
Returns the hash as a 32-character hexadecimal number.

EXAMPLES

Note: In the followings examples, the _ between the { should be removed to make it work.

in:  res={_{md5file("",false)}}.
out: res=d41d8cd98f00b204e9800998ecf8427e.

in:  res={_{md5file("test.md5")}}.
out: res=1bc29b36f623ba82aaf6724fd3b16718.

SEE ALSO

{{ include("includes/cryptography.sn") }}

AUTHOR

Written by Pusnei Sergey, <sergey@sednove.com>

MODIFICATIONS

1.0 2014-09-09 21:24:14 laplante@sednove.com

Edit

© 2024 extenso Inc. All rights reserved.