sha1_file

Returns a sha1 hash for the given file.

Syntax:

sha1_file(filename)


Argument Description
filename The file to generate the sha1 hash for.


Returns: String


Description

In cryptography, SHA-1 is a cryptographic hash function designed by the United States National Security Agency and is employed in several widely used applications popular Git where it is used to check for file changes, and the protocols TLS and SSL, PGP, SSH, S/MIME, and IPsec. This function will take an input file and return a 160 bit message digest in ASCII format unique to that file to be used for integrity verification at any later date.


Example:

hash = sha1_file(working_directory + "\game_data.ini")

The above code will generate a sha1 hash for the specified file and store the returned value in the variable "hash".


Back: File Handling
Next: base64_encode
© Copyright YoYo Games Ltd. 2018 All Rights Reserved