Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/gorge/string.rb
Instance Method Summary collapse
-
#crc32 ⇒ String
Returns the CRC32 checksum (in hexadecimal format) of the String.
-
#md5 ⇒ String
Returns the MD5 hash (in hexadecimal format) of the String.
-
#sha1 ⇒ String
Returns the SHA1 hash (in hexadecimal format) of the String.
-
#sha256 ⇒ String
Returns the SHA256 hash (in hexadecimal format) of the String.
Instance Method Details
#crc32 ⇒ String
Returns the CRC32 checksum (in hexadecimal format) of the String.
6 7 8 |
# File 'lib/gorge/string.rb', line 6 def crc32 Digest::CRC32.hexdigest(self) end |
#md5 ⇒ String
Returns the MD5 hash (in hexadecimal format) of the String.
13 14 15 |
# File 'lib/gorge/string.rb', line 13 def md5 Digest::MD5.hexdigest(self) end |
#sha1 ⇒ String
Returns the SHA1 hash (in hexadecimal format) of the String.
20 21 22 |
# File 'lib/gorge/string.rb', line 20 def sha1 Digest::SHA1.hexdigest(self) end |
#sha256 ⇒ String
Returns the SHA256 hash (in hexadecimal format) of the String.
27 28 29 |
# File 'lib/gorge/string.rb', line 27 def sha256 Digest::SHA256.hexdigest(self) end |