Class: RmDigest::MD5

Inherits:
Object
  • Object
show all
Defined in:
lib/rm-digest/md5.rb

Class Method Summary collapse

Class Method Details

.digest(string, encoding = NSUTF8StringEncoding) ⇒ Object



11
12
13
14
# File 'lib/rm-digest/md5.rb', line 11

def digest(string, encoding = NSUTF8StringEncoding)
  return nil if string.nil?
  RmDigest::Util.toNSData(string, encoding).MD5Digest
end

.hexdigest(string, encoding = NSUTF8StringEncoding) ⇒ Object



6
7
8
9
# File 'lib/rm-digest/md5.rb', line 6

def hexdigest(string, encoding = NSUTF8StringEncoding)
  return nil if string.nil?
  RmDigest::Util.toNSData(string, encoding).MD5HexDigest
end