Sha256: 203bea9012527b8f4655de2cbb4dc0e8c5ea6a1be2634b6941d900fa1355a688

Contents?: true

Size: 253 Bytes

Versions: 1

Compression:

Stored size: 253 Bytes

Contents

# encoding: utf-8

module Rubymisc
  module String
    def ^(key)
      key_num = key.bytes.cycle
      bytes.map { |byte| byte ^ key_num.next }.pack('C*').force_encoding(self.encoding)
    end
  end
end

::String.module_eval 'include Rubymisc::String'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubymisc-0.0.3 lib/rubymisc/ext/string.rb