Class: Pathname
- Inherits:
-
Object
- Object
- Pathname
- Defined in:
- lib/gorge/pathname.rb
Instance Method Summary collapse
-
#file_crc32 ⇒ String
Returns the CRC32 checksum (in hexadecimal format) of the contents of the file indicated by the Pathname.
-
#file_md5 ⇒ String
Returns the MD5 hash (in hexadecimal format) of the contents of the file indicated by the Pathname.
-
#file_sha1 ⇒ String
Returns the SHA1 hash (in hexadecimal format) of the contents of the file indicated by the Pathname.
-
#file_sha256 ⇒ String
Returns the SHA256 hash (in hexadecimal format) of the contents of the file indicated by the Pathname.
Instance Method Details
#file_crc32 ⇒ String
Returns the CRC32 checksum (in hexadecimal format) of the contents of the file indicated by the Pathname.
9 10 11 |
# File 'lib/gorge/pathname.rb', line 9 def file_crc32 Digest::CRC32.file(self).hexdigest end |
#file_md5 ⇒ String
Returns the MD5 hash (in hexadecimal format) of the contents of the file indicated by the Pathname.
17 18 19 |
# File 'lib/gorge/pathname.rb', line 17 def file_md5 Digest::MD5.file(self).hexdigest end |
#file_sha1 ⇒ String
Returns the SHA1 hash (in hexadecimal format) of the contents of the file indicated by the Pathname.
25 26 27 |
# File 'lib/gorge/pathname.rb', line 25 def file_sha1 Digest::SHA1.file(self).hexdigest end |
#file_sha256 ⇒ String
Returns the SHA256 hash (in hexadecimal format) of the contents of the file indicated by the Pathname.
33 34 35 |
# File 'lib/gorge/pathname.rb', line 33 def file_sha256 Digest::SHA256.file(self).hexdigest end |