Added remote digest methods
This commit is contained in:
parent
2e60d2e01a
commit
8d19bca2a9
|
@ -33,6 +33,15 @@ module File
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#
|
||||||
|
# Returns a MD5 checksum of a given remote file
|
||||||
|
#
|
||||||
|
|
||||||
|
def file_remote_digestmd5(file2md5)
|
||||||
|
chksum = Digest::MD5.hexdigest(read_file(file2md5))
|
||||||
|
return chksum
|
||||||
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
# Returns a SHA1 checksum of a given local file
|
# Returns a SHA1 checksum of a given local file
|
||||||
#
|
#
|
||||||
|
@ -47,6 +56,15 @@ module File
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#
|
||||||
|
# Returns a SHA1 checksum of a given remote file
|
||||||
|
#
|
||||||
|
|
||||||
|
def file_remote_digestsha1(file2sha1)
|
||||||
|
chksum = Digest::SHA1.hexdigest(read_file(file2sha1))
|
||||||
|
return chksum
|
||||||
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
# Returns a SHA256 checksum of a given local file
|
# Returns a SHA256 checksum of a given local file
|
||||||
#
|
#
|
||||||
|
@ -61,6 +79,15 @@ module File
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#
|
||||||
|
# Returns a SHA2 checksum of a given remote file
|
||||||
|
#
|
||||||
|
|
||||||
|
def file_remote_digestsha2(file2sha2)
|
||||||
|
chksum = Digest::SHA256.hexdigest(read_file(file2sha2))
|
||||||
|
return chksum
|
||||||
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
# Platform-agnostic file read. Returns contents of remote file +file_name+
|
# Platform-agnostic file read. Returns contents of remote file +file_name+
|
||||||
# as a String.
|
# as a String.
|
||||||
|
|
Loading…
Reference in New Issue