Sha256: 30bf9a57b3d44f3d6da05cd037956f2ef3dc900b0385a542a3cbb343a7da2288

Contents?: true

Size: 501 Bytes

Versions: 48

Compression:

Stored size: 501 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require 'optparse'

opts = {}
OptionParser.new do |options|
  options.banner = "USAGE:
    #{File.basename($PROGRAM_NAME)} [opts]
  "

  options.on('-pSTRING', '--payload=STRING', '<Required - String to Encode>') do |p|
    opts[:payload] = p
  end
end.parse!

if opts.empty?
  puts `#{File.basename($PROGRAM_NAME)} --help`
  exit 1
end

payload = opts[:payload].to_s.scrub
puts payload.unpack('U*').map { |i| "\\u#{i.to_s(16).rjust(4, '0')}" }.join

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
pwn-0.5.214 bin/pwn_char_unicode_escaped_encoding
pwn-0.5.213 bin/pwn_char_unicode_escaped_encoding
pwn-0.5.212 bin/pwn_char_unicode_escaped_encoding
pwn-0.5.211 bin/pwn_char_unicode_escaped_encoding
pwn-0.5.210 bin/pwn_char_unicode_escaped_encoding
pwn-0.5.209 bin/pwn_char_unicode_escaped_encoding
pwn-0.5.207 bin/pwn_char_unicode_escaped_encoding
pwn-0.5.206 bin/pwn_char_unicode_escaped_encoding
pwn-0.5.205 bin/pwn_char_unicode_escaped_encoding
pwn-0.5.204 bin/pwn_char_unicode_escaped_encoding
pwn-0.5.203 bin/pwn_char_unicode_escaped_encoding
pwn-0.5.202 bin/pwn_char_unicode_escaped_encoding
pwn-0.5.201 bin/pwn_char_unicode_escaped_encoding
pwn-0.5.200 bin/pwn_char_unicode_escaped_encoding
pwn-0.5.199 bin/pwn_char_unicode_escaped_encoding
pwn-0.5.198 bin/pwn_char_unicode_escaped_encoding
pwn-0.5.197 bin/pwn_char_unicode_escaped_encoding
pwn-0.5.196 bin/pwn_char_unicode_escaped_encoding
pwn-0.5.195 bin/pwn_char_unicode_escaped_encoding
pwn-0.5.194 bin/pwn_char_unicode_escaped_encoding