Skip to main content

Get file SHA1 (file.sha1)

Declaration

sha1, err = file.sha1(path)

Parameters

  • path
    String. Absolute file path.

Returns

  • sha1
    String or nil. nil if file does not exist or path is a directory; otherwise the file SHA1 value.
  • err
    String. Error message when operation fails.

Notes

Get the SHA1 value of a file.

Example

local sha1, err = file.sha1("/var/mobile/1.zip")
if sha1 then
sys.alert("/var/mobile/1.zip SHA1: "..sha1)
else
sys.alert("/var/mobile/1.zip is not a file: "..err)
end

Note: Uses sys.alert