Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/gorge/string.rb

Instance Method Summary collapse

Instance Method Details

#crc32String

Returns the CRC32 checksum (in hexadecimal format) of the String.

Returns:



6
7
8
# File 'lib/gorge/string.rb', line 6

def crc32
  Digest::CRC32.hexdigest(self)
end

#md5String

Returns the MD5 hash (in hexadecimal format) of the String.

Returns:



13
14
15
# File 'lib/gorge/string.rb', line 13

def md5
  Digest::MD5.hexdigest(self)
end

#sha1String

Returns the SHA1 hash (in hexadecimal format) of the String.

Returns:



20
21
22
# File 'lib/gorge/string.rb', line 20

def sha1
  Digest::SHA1.hexdigest(self)
end

#sha256String

Returns the SHA256 hash (in hexadecimal format) of the String.

Returns:



27
28
29
# File 'lib/gorge/string.rb', line 27

def sha256
  Digest::SHA256.hexdigest(self)
end