Class: String

Inherits:
Object show all
Defined in:
lib/sh_util.rb

Instance Method Summary collapse

Instance Method Details

#to_md5Object



54
55
56
# File 'lib/sh_util.rb', line 54

def to_md5
  return (Digest::MD5.new << self).to_s
end

#to_uObject



58
59
60
61
62
63
64
65
# File 'lib/sh_util.rb', line 58

def to_u
  if is_binary_data?
  	return isutf8 ? self : nil
  else
    utf8 = isutf8
    return utf8 ? utf8.to_s : unpack('C*').pack('U*')
  end
end