Sha256: 70d98fb124a4292573bd168cbb7b1f5c54151e5baa8cc30cb89999ad8314072d
Contents?: true
Size: 538 Bytes
Versions: 2
Compression:
Stored size: 538 Bytes
Contents
module CryptoconditionsRuby module Utils class Base16 def self.encode(data) ret = '' data.each_char do |c| ch = c.ord.to_s(16) ch = '0' + ch if ch.size == 1 ret += ch end ret.upcase end def self.decode(data) chars = '' ret = '' data.each_char do |c| chars += c if chars.size == 2 ret += chars.to_i(16).chr chars = '' end end ret end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
cryptoconditions_ruby-0.5.2 | lib/cryptoconditions_ruby/utils/base16.rb |
cryptoconditions_ruby-0.5.1 | lib/cryptoconditions_ruby/utils/base16.rb |