X7ROOT File Manager
Current Path:
/opt/alt/ruby24/lib64/ruby/2.4.0
opt
/
alt
/
ruby24
/
lib64
/
ruby
/
2.4.0
/
??
..
??
English.rb
(6.45 KB)
??
abbrev.rb
(3.49 KB)
??
base64.rb
(3.31 KB)
??
benchmark.rb
(17.9 KB)
??
cgi
??
cgi.rb
(9.8 KB)
??
cmath.rb
(9.48 KB)
??
csv.rb
(83.53 KB)
??
date.rb
(1004 B)
??
debug.rb
(29.98 KB)
??
delegate.rb
(10.31 KB)
??
digest
??
digest.rb
(2.83 KB)
??
drb
??
drb.rb
(50 B)
??
e2mmap.rb
(3.94 KB)
??
erb.rb
(27.25 KB)
??
expect.rb
(2.17 KB)
??
fiddle
??
fiddle.rb
(1.68 KB)
??
fileutils.rb
(44.06 KB)
??
find.rb
(2.52 KB)
??
forwardable
??
forwardable.rb
(8.5 KB)
??
getoptlong.rb
(15.41 KB)
??
io
??
ipaddr.rb
(17.1 KB)
??
irb
??
irb.rb
(20.29 KB)
??
json
??
json.rb
(1.77 KB)
??
kconv.rb
(5.77 KB)
??
logger.rb
(23.53 KB)
??
mathn.rb
(3.42 KB)
??
matrix
??
matrix.rb
(53.37 KB)
??
mkmf.rb
(84.32 KB)
??
monitor.rb
(7.02 KB)
??
mutex_m.rb
(2.04 KB)
??
net
??
observer.rb
(5.83 KB)
??
open-uri.rb
(24.76 KB)
??
open3.rb
(20.59 KB)
??
openssl
??
openssl.rb
(445 B)
??
optionparser.rb
(59 B)
??
optparse
??
optparse.rb
(57.25 KB)
??
ostruct.rb
(10.2 KB)
??
pathname.rb
(16.08 KB)
??
pp.rb
(14.43 KB)
??
prettyprint.rb
(15.89 KB)
??
prime.rb
(12.49 KB)
??
profile.rb
(236 B)
??
profiler.rb
(4.54 KB)
??
pstore.rb
(14.71 KB)
??
psych
??
psych.rb
(15.25 KB)
??
racc
??
rbconfig
??
rdoc
??
rdoc.rb
(5.07 KB)
??
resolv-replace.rb
(1.76 KB)
??
resolv.rb
(73.48 KB)
??
rexml
??
rinda
??
ripper
??
ripper.rb
(2.56 KB)
??
rss
??
rss.rb
(2.87 KB)
??
rubygems
??
rubygems.rb
(35.38 KB)
??
scanf.rb
(23.56 KB)
??
securerandom.rb
(7.48 KB)
??
set.rb
(20.74 KB)
??
shell
??
shell.rb
(11.37 KB)
??
shellwords.rb
(6.66 KB)
??
singleton.rb
(4.06 KB)
??
socket.rb
(42.99 KB)
??
sync.rb
(7.29 KB)
??
syslog
??
tempfile.rb
(10.8 KB)
??
thwait.rb
(3.35 KB)
??
time.rb
(22.36 KB)
??
timeout.rb
(3.83 KB)
??
tmpdir.rb
(4.29 KB)
??
tracer.rb
(6.44 KB)
??
tsort.rb
(14.3 KB)
??
ubygems.rb
(298 B)
??
un.rb
(9.18 KB)
??
unicode_normalize
??
unicode_normalize.rb
(3.2 KB)
??
uri
??
uri.rb
(3.1 KB)
??
weakref.rb
(2.95 KB)
??
webrick
??
webrick.rb
(6.72 KB)
??
x86_64-linux
??
yaml
??
yaml.rb
(1.73 KB)
Editing: base64.rb
# frozen_string_literal: false # # = base64.rb: methods for base64-encoding and -decoding strings # # The Base64 module provides for the encoding (#encode64, #strict_encode64, # #urlsafe_encode64) and decoding (#decode64, #strict_decode64, # #urlsafe_decode64) of binary data using a Base64 representation. # # == Example # # A simple encoding and decoding. # # require "base64" # # enc = Base64.encode64('Send reinforcements') # # -> "U2VuZCByZWluZm9yY2VtZW50cw==\n" # plain = Base64.decode64(enc) # # -> "Send reinforcements" # # The purpose of using base64 to encode data is that it translates any # binary data into purely printable characters. module Base64 module_function # Returns the Base64-encoded version of +bin+. # This method complies with RFC 2045. # Line feeds are added to every 60 encoded characters. # # require 'base64' # Base64.encode64("Now is the time for all good coders\nto learn Ruby") # # <i>Generates:</i> # # Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMKdG8gbGVhcm4g # UnVieQ== def encode64(bin) [bin].pack("m") end # Returns the Base64-decoded version of +str+. # This method complies with RFC 2045. # Characters outside the base alphabet are ignored. # # require 'base64' # str = 'VGhpcyBpcyBsaW5lIG9uZQpUaGlzIG' + # 'lzIGxpbmUgdHdvClRoaXMgaXMgbGlu' + # 'ZSB0aHJlZQpBbmQgc28gb24uLi4K' # puts Base64.decode64(str) # # <i>Generates:</i> # # This is line one # This is line two # This is line three # And so on... def decode64(str) str.unpack("m").first end # Returns the Base64-encoded version of +bin+. # This method complies with RFC 4648. # No line feeds are added. def strict_encode64(bin) [bin].pack("m0") end # Returns the Base64-decoded version of +str+. # This method complies with RFC 4648. # ArgumentError is raised if +str+ is incorrectly padded or contains # non-alphabet characters. Note that CR or LF are also rejected. def strict_decode64(str) str.unpack("m0").first end # Returns the Base64-encoded version of +bin+. # This method complies with ``Base 64 Encoding with URL and Filename Safe # Alphabet'' in RFC 4648. # The alphabet uses '-' instead of '+' and '_' instead of '/'. # Note that the result can still contain '='. # You can remove the padding by setting +padding+ as false. def urlsafe_encode64(bin, padding: true) str = strict_encode64(bin).tr("+/", "-_") str = str.delete("=") unless padding str end # Returns the Base64-decoded version of +str+. # This method complies with ``Base 64 Encoding with URL and Filename Safe # Alphabet'' in RFC 4648. # The alphabet uses '-' instead of '+' and '_' instead of '/'. # # The padding character is optional. # This method accepts both correctly-padded and unpadded input. # Note that it still rejects incorrectly-padded input. def urlsafe_decode64(str) # NOTE: RFC 4648 does say nothing about unpadded input, but says that # "the excess pad characters MAY also be ignored", so it is inferred that # unpadded input is also acceptable. str = str.tr("-_", "+/") if !str.end_with?("=") && str.length % 4 != 0 str = str.ljust((str.length + 3) & ~3, "=") end strict_decode64(str) end end
Upload File
Create Folder