base64 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/base64.rb +4 -2
- metadata +3 -10
- data/.github/workflows/test.yml +0 -24
- data/.gitignore +0 -8
- data/Gemfile +0 -4
- data/Rakefile +0 -10
- data/base64.gemspec +0 -22
- data/bin/console +0 -14
- data/bin/setup +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9cdb7f1229721d778c55acf3ba0d52d0cfd01af75b642879cad18c897324f2d3
|
4
|
+
data.tar.gz: f14d863cab6d699c6ed29f7c463da7b6fe0566410dbc21bdfc5c6880b0cd5056
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b38e41b62859eeb7d5ec7a2111c323e5dca272889f3a8d611fec3c8cc9cc2bfc932f243544d1f3edd745930cac9a340de0d7deb03c2e6f85b12b9a5be77f2f7
|
7
|
+
data.tar.gz: 7ebc528a0e7256f18f5efb8d5e69cc1599c640d1393124d08c33ad643ba45764f003830c9820282b2487f162f2db9681f811142e45bd3f9537e437f3becb9ef1
|
data/lib/base64.rb
CHANGED
@@ -82,8 +82,8 @@ module Base64
|
|
82
82
|
# You can remove the padding by setting +padding+ as false.
|
83
83
|
def urlsafe_encode64(bin, padding: true)
|
84
84
|
str = strict_encode64(bin)
|
85
|
+
str.chomp!("==") or str.chomp!("=") unless padding
|
85
86
|
str.tr!("+/", "-_")
|
86
|
-
str.delete!("=") unless padding
|
87
87
|
str
|
88
88
|
end
|
89
89
|
|
@@ -99,9 +99,11 @@ module Base64
|
|
99
99
|
# NOTE: RFC 4648 does say nothing about unpadded input, but says that
|
100
100
|
# "the excess pad characters MAY also be ignored", so it is inferred that
|
101
101
|
# unpadded input is also acceptable.
|
102
|
-
str = str.tr("-_", "+/")
|
103
102
|
if !str.end_with?("=") && str.length % 4 != 0
|
104
103
|
str = str.ljust((str.length + 3) & ~3, "=")
|
104
|
+
str.tr!("-_", "+/")
|
105
|
+
else
|
106
|
+
str = str.tr("-_", "+/")
|
105
107
|
end
|
106
108
|
strict_decode64(str)
|
107
109
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: base64
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yusuke Endoh
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Support for encoding and decoding binary data using a Base64 representation.
|
14
14
|
email:
|
@@ -17,15 +17,8 @@ executables: []
|
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
-
- ".github/workflows/test.yml"
|
21
|
-
- ".gitignore"
|
22
|
-
- Gemfile
|
23
20
|
- LICENSE.txt
|
24
21
|
- README.md
|
25
|
-
- Rakefile
|
26
|
-
- base64.gemspec
|
27
|
-
- bin/console
|
28
|
-
- bin/setup
|
29
22
|
- lib/base64.rb
|
30
23
|
homepage: https://github.com/ruby/base64
|
31
24
|
licenses:
|
@@ -49,7 +42,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
49
42
|
- !ruby/object:Gem::Version
|
50
43
|
version: '0'
|
51
44
|
requirements: []
|
52
|
-
rubygems_version: 3.2.
|
45
|
+
rubygems_version: 3.2.22
|
53
46
|
signing_key:
|
54
47
|
specification_version: 4
|
55
48
|
summary: Support for encoding and decoding binary data using a Base64 representation.
|
data/.github/workflows/test.yml
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
name: test
|
2
|
-
|
3
|
-
on: [push, pull_request]
|
4
|
-
|
5
|
-
jobs:
|
6
|
-
build:
|
7
|
-
name: build (${{ matrix.ruby }} / ${{ matrix.os }})
|
8
|
-
strategy:
|
9
|
-
matrix:
|
10
|
-
ruby: [ 2.7, 2.6, 2.5, head ]
|
11
|
-
os: [ ubuntu-latest, macos-latest ]
|
12
|
-
runs-on: ${{ matrix.os }}
|
13
|
-
steps:
|
14
|
-
- uses: actions/checkout@master
|
15
|
-
- name: Set up Ruby
|
16
|
-
uses: ruby/setup-ruby@v1
|
17
|
-
with:
|
18
|
-
ruby-version: ${{ matrix.ruby }}
|
19
|
-
- name: Install dependencies
|
20
|
-
run: |
|
21
|
-
gem install bundler --no-document
|
22
|
-
bundle install
|
23
|
-
- name: Run test
|
24
|
-
run: rake test
|
data/.gitignore
DELETED
data/Gemfile
DELETED
data/Rakefile
DELETED
data/base64.gemspec
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
Gem::Specification.new do |spec|
|
2
|
-
spec.name = "base64"
|
3
|
-
spec.version = "0.1.0"
|
4
|
-
spec.authors = ["Yusuke Endoh"]
|
5
|
-
spec.email = ["mame@ruby-lang.org"]
|
6
|
-
|
7
|
-
spec.summary = %q{Support for encoding and decoding binary data using a Base64 representation.}
|
8
|
-
spec.description = %q{Support for encoding and decoding binary data using a Base64 representation.}
|
9
|
-
spec.homepage = "https://github.com/ruby/base64"
|
10
|
-
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
11
|
-
spec.licenses = ["Ruby", "BSD-2-Clause"]
|
12
|
-
|
13
|
-
spec.metadata["homepage_uri"] = spec.homepage
|
14
|
-
spec.metadata["source_code_uri"] = spec.homepage
|
15
|
-
|
16
|
-
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
17
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
-
end
|
19
|
-
spec.bindir = "exe"
|
20
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
|
-
spec.require_paths = ["lib"]
|
22
|
-
end
|
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "base64"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start(__FILE__)
|