ob64 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +9 -0
- data/.github/workflows/main.yml +78 -16
- data/.standard.yml +1 -2
- data/CHANGELOG.md +19 -1
- data/Gemfile +1 -1
- data/README.md +65 -21
- data/benchmark.rb +62 -95
- data/bin/rake +27 -0
- data/ext/ob64/extconf.rb +0 -42
- data/ext/ob64/ob64.h +3 -1
- data/ext/ob64/ob64_ext.c +80 -23
- data/ext/ob64/ob64_pack.c +289 -0
- data/ext/ob64/pack_base64.c +5209 -0
- data/ext/ob64/pack_base64.h +36 -0
- data/ext/ob64/pack_generic.h +151 -0
- data/ext/ob64/pack_simd.h +22 -0
- data/ext/ob64/pack_uuencode.c +1741 -0
- data/ext/ob64/pack_uuencode.h +18 -0
- data/lib/ob64/core_ext.rb +2 -25
- data/lib/ob64/version.rb +1 -1
- data/lib/ob64.rb +218 -70
- data/ob64.gemspec +3 -5
- metadata +18 -73
- data/.gitmodules +0 -3
- data/ext/ob64/libbase64.h +0 -1
- data/vendor/libbase64/.gitignore +0 -12
- data/vendor/libbase64/.travis.yml +0 -71
- data/vendor/libbase64/CMakeLists.txt +0 -264
- data/vendor/libbase64/LICENSE +0 -28
- data/vendor/libbase64/Makefile +0 -93
- data/vendor/libbase64/README.md +0 -474
- data/vendor/libbase64/base64-benchmarks.png +0 -0
- data/vendor/libbase64/bin/base64.c +0 -132
- data/vendor/libbase64/cmake/Modules/TargetArch.cmake +0 -29
- data/vendor/libbase64/cmake/Modules/TargetSIMDInstructionSet.cmake +0 -34
- data/vendor/libbase64/cmake/base64-config.cmake.in +0 -5
- data/vendor/libbase64/cmake/config.h.in +0 -25
- data/vendor/libbase64/cmake/test-arch.c +0 -35
- data/vendor/libbase64/include/libbase64.h +0 -145
- data/vendor/libbase64/lib/arch/avx/codec.c +0 -42
- data/vendor/libbase64/lib/arch/avx2/codec.c +0 -42
- data/vendor/libbase64/lib/arch/avx2/dec_loop.c +0 -110
- data/vendor/libbase64/lib/arch/avx2/dec_reshuffle.c +0 -34
- data/vendor/libbase64/lib/arch/avx2/enc_loop.c +0 -89
- data/vendor/libbase64/lib/arch/avx2/enc_reshuffle.c +0 -83
- data/vendor/libbase64/lib/arch/avx2/enc_translate.c +0 -30
- data/vendor/libbase64/lib/arch/generic/32/dec_loop.c +0 -86
- data/vendor/libbase64/lib/arch/generic/32/enc_loop.c +0 -73
- data/vendor/libbase64/lib/arch/generic/64/enc_loop.c +0 -77
- data/vendor/libbase64/lib/arch/generic/codec.c +0 -39
- data/vendor/libbase64/lib/arch/generic/dec_head.c +0 -37
- data/vendor/libbase64/lib/arch/generic/dec_tail.c +0 -91
- data/vendor/libbase64/lib/arch/generic/enc_head.c +0 -24
- data/vendor/libbase64/lib/arch/generic/enc_tail.c +0 -34
- data/vendor/libbase64/lib/arch/neon32/codec.c +0 -72
- data/vendor/libbase64/lib/arch/neon32/dec_loop.c +0 -106
- data/vendor/libbase64/lib/arch/neon32/enc_loop.c +0 -58
- data/vendor/libbase64/lib/arch/neon32/enc_reshuffle.c +0 -54
- data/vendor/libbase64/lib/arch/neon32/enc_translate.c +0 -57
- data/vendor/libbase64/lib/arch/neon64/codec.c +0 -70
- data/vendor/libbase64/lib/arch/neon64/dec_loop.c +0 -129
- data/vendor/libbase64/lib/arch/neon64/enc_loop.c +0 -66
- data/vendor/libbase64/lib/arch/neon64/enc_reshuffle.c +0 -54
- data/vendor/libbase64/lib/arch/sse41/codec.c +0 -42
- data/vendor/libbase64/lib/arch/sse42/codec.c +0 -42
- data/vendor/libbase64/lib/arch/ssse3/codec.c +0 -42
- data/vendor/libbase64/lib/arch/ssse3/dec_loop.c +0 -173
- data/vendor/libbase64/lib/arch/ssse3/dec_reshuffle.c +0 -33
- data/vendor/libbase64/lib/arch/ssse3/enc_loop.c +0 -67
- data/vendor/libbase64/lib/arch/ssse3/enc_reshuffle.c +0 -48
- data/vendor/libbase64/lib/arch/ssse3/enc_translate.c +0 -33
- data/vendor/libbase64/lib/codec_choose.c +0 -281
- data/vendor/libbase64/lib/codecs.h +0 -65
- data/vendor/libbase64/lib/env.h +0 -67
- data/vendor/libbase64/lib/exports.txt +0 -7
- data/vendor/libbase64/lib/lib.c +0 -164
- data/vendor/libbase64/lib/lib_openmp.c +0 -149
- data/vendor/libbase64/lib/tables/.gitignore +0 -1
- data/vendor/libbase64/lib/tables/Makefile +0 -17
- data/vendor/libbase64/lib/tables/table_dec_32bit.h +0 -393
- data/vendor/libbase64/lib/tables/table_enc_12bit.h +0 -1031
- data/vendor/libbase64/lib/tables/table_enc_12bit.py +0 -45
- data/vendor/libbase64/lib/tables/table_generator.c +0 -184
- data/vendor/libbase64/lib/tables/tables.c +0 -40
- data/vendor/libbase64/lib/tables/tables.h +0 -23
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#ifndef PACK_UUENCODE_H
|
|
2
|
+
#define PACK_UUENCODE_H
|
|
3
|
+
|
|
4
|
+
#include <stddef.h>
|
|
5
|
+
|
|
6
|
+
size_t pack_uuencode_encode(const char *src, size_t srclen, char *out);
|
|
7
|
+
/* Encodes like native pack("u") with line_len (a multiple of 3, 3..63) bytes per line; returns the length */
|
|
8
|
+
size_t pack_uuencode_lines(const char *src, size_t srclen, char *out, size_t line_len);
|
|
9
|
+
size_t pack_uuencode_decode(const char *src, size_t srclen, char *out);
|
|
10
|
+
/* Upper bound of the decoded length of srclen chars: srclen * 3 / 4 without overflow */
|
|
11
|
+
size_t pack_uudecode_cap(size_t srclen);
|
|
12
|
+
/*
|
|
13
|
+
* Decodes like native unpack("u") and returns the decoded length. out needs
|
|
14
|
+
* pack_uudecode_cap(srclen) + 3 bytes; NULL computes the length only.
|
|
15
|
+
*/
|
|
16
|
+
size_t pack_uudecode_lines(const char *src, size_t srclen, char *out);
|
|
17
|
+
|
|
18
|
+
#endif /* PACK_UUENCODE_H */
|
data/lib/ob64/core_ext.rb
CHANGED
|
@@ -1,29 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "ob64"
|
|
4
|
-
require "base64"
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def strict_encode64(bin)
|
|
9
|
-
Ob64.strictier_encode(bin)
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
def strict_decode64(str)
|
|
13
|
-
Ob64.strictier_decode(str)
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
def urlsafe_encode64(bin, padding: true)
|
|
17
|
-
Ob64.urlsafe_encode(bin, padding: padding)
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def urlsafe_decode64(str)
|
|
21
|
-
Ob64.urlsafe_decode(str)
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
::Base64.prepend(CoreExt)
|
|
26
|
-
::Base64.singleton_class.prepend(CoreExt)
|
|
27
|
-
|
|
28
|
-
private_constant :CoreExt
|
|
29
|
-
end
|
|
5
|
+
::Array.prepend(Ob64::Ext::Pack)
|
|
6
|
+
::String.prepend(Ob64::Ext::Unpack)
|
data/lib/ob64/version.rb
CHANGED
data/lib/ob64.rb
CHANGED
|
@@ -3,94 +3,242 @@
|
|
|
3
3
|
require_relative "ob64/version"
|
|
4
4
|
require_relative "ob64_ext"
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# Fast base64 and uuencode encoding and decoding: see {Base64::RFC4648},
|
|
7
|
+
# {Base64::RFC2045} and {UU}.
|
|
7
8
|
module Ob64
|
|
8
|
-
# The glue between Ruby and
|
|
9
|
-
module
|
|
9
|
+
# The glue between Ruby and the C codecs. See +../ext/ob64/ob64_ext.c+.
|
|
10
|
+
module Ext; end
|
|
10
11
|
|
|
11
|
-
include
|
|
12
|
-
extend
|
|
12
|
+
include Ext
|
|
13
|
+
extend Ext
|
|
13
14
|
|
|
14
15
|
module_function
|
|
15
16
|
|
|
16
|
-
# Returns the Base64
|
|
17
|
-
#
|
|
18
|
-
# No line feeds are added.
|
|
17
|
+
# Returns the codec used by {Base64}, {UU} and, with +ob64/core_ext+,
|
|
18
|
+
# +pack+ and +unpack+ with +m+ and +u+. Defaults to {best_codec}.
|
|
19
19
|
#
|
|
20
|
-
# @
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
__encode(bin)
|
|
20
|
+
# @return [Symbol] one of {codecs}
|
|
21
|
+
def codec
|
|
22
|
+
__codec
|
|
24
23
|
end
|
|
25
24
|
|
|
26
|
-
#
|
|
27
|
-
# This method complies with RFC 4648.
|
|
28
|
-
# ArgumentError is raised if +string+ is incorrectly padded or contains
|
|
29
|
-
# non-alphabet characters. Note that CR or LF are also rejected.
|
|
25
|
+
# Forces a codec for the whole process: every thread and Ractor.
|
|
30
26
|
#
|
|
31
|
-
# @param
|
|
32
|
-
# @return [
|
|
33
|
-
# @raise [ArgumentError] if +
|
|
34
|
-
def
|
|
35
|
-
|
|
27
|
+
# @param codec [Symbol] one of {codecs}
|
|
28
|
+
# @return [Symbol] +codec+
|
|
29
|
+
# @raise [ArgumentError] if +codec+ is unknown or this CPU cannot run it
|
|
30
|
+
def codec=(codec)
|
|
31
|
+
__set_codec(codec)
|
|
36
32
|
end
|
|
37
33
|
|
|
38
|
-
# Returns the
|
|
39
|
-
# This method complies with ``Base 64 Encoding with URL and Filename Safe
|
|
40
|
-
# Alphabet'' in RFC 4648.
|
|
41
|
-
# The alphabet uses '-' instead of '+' and '_' instead of '/'.
|
|
42
|
-
# Note that the result can still contain '='.
|
|
43
|
-
# You can remove the padding by setting +padding+ as false.
|
|
34
|
+
# Returns the codecs this CPU runs, best last. +:scalar+ is plain C.
|
|
44
35
|
#
|
|
45
|
-
# @
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
def urlsafe_encode(bin, padding: true)
|
|
49
|
-
string = __encode(bin)
|
|
50
|
-
string.chomp!("==") || string.chomp!("=") unless padding
|
|
51
|
-
string.tr!("+/", "-_")
|
|
52
|
-
string
|
|
36
|
+
# @return [Array<Symbol>] among +:scalar+, +:avx2+, +:avx512+, +:neon64+
|
|
37
|
+
def codecs
|
|
38
|
+
__codecs
|
|
53
39
|
end
|
|
54
40
|
|
|
55
|
-
# Returns the
|
|
56
|
-
# This method complies with ``Base 64 Encoding with URL and Filename Safe
|
|
57
|
-
# Alphabet'' in RFC 4648.
|
|
58
|
-
# The alphabet uses '-' instead of '+' and '_' instead of '/'.
|
|
41
|
+
# Returns the best codec this CPU runs, the default {codec}.
|
|
59
42
|
#
|
|
60
|
-
#
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
#
|
|
64
|
-
# @param string [String]
|
|
65
|
-
# @return [String]
|
|
66
|
-
# @raise [ArgumentError] if +string+ cannot be decoded
|
|
67
|
-
def urlsafe_decode(string)
|
|
68
|
-
if !string.end_with?("=") && string.length % 4 != 0
|
|
69
|
-
string = string.ljust((string.length + 3) & ~3, "=")
|
|
70
|
-
string.tr!("-_", "+/")
|
|
71
|
-
else
|
|
72
|
-
string = string.tr("-_", "+/")
|
|
73
|
-
end
|
|
74
|
-
__decode(string)
|
|
43
|
+
# @return [Symbol] one of {codecs}
|
|
44
|
+
def best_codec
|
|
45
|
+
codecs.last
|
|
75
46
|
end
|
|
76
47
|
|
|
77
|
-
#
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
48
|
+
# Base64 encoding and decoding, one module per RFC: {RFC4648} and {RFC2045}.
|
|
49
|
+
module Base64
|
|
50
|
+
# Base64 as in RFC 4648: no line breaks, strict decoding.
|
|
51
|
+
module RFC4648
|
|
52
|
+
include Ext
|
|
53
|
+
extend Ext
|
|
54
|
+
|
|
55
|
+
module_function
|
|
56
|
+
|
|
57
|
+
# Returns the Base64-encoded version of +bin+, like
|
|
58
|
+
# <tt>[bin].pack("m0")</tt>. No line feeds are added.
|
|
59
|
+
#
|
|
60
|
+
# @param bin [String]
|
|
61
|
+
# @return [String]
|
|
62
|
+
def encode(bin)
|
|
63
|
+
__encode(bin, false, true)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Returns the Base64-decoded version of +string+, like
|
|
67
|
+
# <tt>string.unpack1("m0")</tt>.
|
|
68
|
+
# ArgumentError is raised if +string+ is incorrectly padded or contains
|
|
69
|
+
# non-alphabet characters. Note that CR or LF are also rejected.
|
|
70
|
+
#
|
|
71
|
+
# With +loose+, the padding character is optional: both correctly-padded
|
|
72
|
+
# and unpadded input are accepted. Incorrectly-padded input is still
|
|
73
|
+
# rejected.
|
|
74
|
+
#
|
|
75
|
+
# @param string [String]
|
|
76
|
+
# @param loose [Boolean] - if unpadded input is accepted
|
|
77
|
+
# @return [String]
|
|
78
|
+
# @raise [ArgumentError] if +string+ cannot be decoded
|
|
79
|
+
def decode(string, loose: false)
|
|
80
|
+
__decode(string, false, loose)
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Returns the Base64-encoded version of +bin+ with the ``URL and Filename
|
|
84
|
+
# Safe'' alphabet: '-' instead of '+' and '_' instead of '/'.
|
|
85
|
+
# Note that the result can still contain '='.
|
|
86
|
+
# You can remove the padding by setting +padding+ as false.
|
|
87
|
+
#
|
|
88
|
+
# @param bin [String]
|
|
89
|
+
# @param padding [Boolean] - if the output must be padded
|
|
90
|
+
# @return [String]
|
|
91
|
+
def encode_urlsafe(bin, padding: true)
|
|
92
|
+
__encode(bin, true, padding)
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Returns the Base64-decoded version of +string+ with the ``URL and
|
|
96
|
+
# Filename Safe'' alphabet: '-' instead of '+' and '_' instead of '/'.
|
|
97
|
+
#
|
|
98
|
+
# The padding character is optional.
|
|
99
|
+
# This method accepts both correctly-padded and unpadded input.
|
|
100
|
+
# Note that it still rejects incorrectly-padded input.
|
|
101
|
+
#
|
|
102
|
+
# @param string [String]
|
|
103
|
+
# @return [String]
|
|
104
|
+
# @raise [ArgumentError] if +string+ cannot be decoded
|
|
105
|
+
def decode_urlsafe(string)
|
|
106
|
+
__decode(string, true, true)
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Returns the length of {encode} (or, with the same +padding+,
|
|
110
|
+
# {encode_urlsafe}) of +bin+.
|
|
111
|
+
#
|
|
112
|
+
# Fast: computed from +bin+'s length.
|
|
113
|
+
#
|
|
114
|
+
# @param bin [String]
|
|
115
|
+
# @param padding [Boolean] - if the Base64-encoded version of +bin+ will be padded
|
|
116
|
+
# @return [Integer]
|
|
117
|
+
def encoded_length_of(bin, padding: true)
|
|
118
|
+
__encoded_length_of(bin, padding)
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Returns the length of {decode} (or {decode_urlsafe}) of +string+,
|
|
122
|
+
# padded or not.
|
|
123
|
+
#
|
|
124
|
+
# Fast: computed from +string+'s length and its last two characters. It
|
|
125
|
+
# doesn't validate the rest, so decoding may still raise.
|
|
126
|
+
#
|
|
127
|
+
# @param string [String]
|
|
128
|
+
# @return [Integer]
|
|
129
|
+
# @raise [ArgumentError] if +string+ has an invalid length
|
|
130
|
+
def decoded_length_of(string)
|
|
131
|
+
__decoded_length_of(string)
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Base64 as in RFC 2045 (MIME): line breaks, lenient decoding.
|
|
136
|
+
module RFC2045
|
|
137
|
+
include Ext
|
|
138
|
+
extend Ext
|
|
139
|
+
|
|
140
|
+
module_function
|
|
141
|
+
|
|
142
|
+
# Returns the Base64-encoded version of +bin+ in lines of +line_length+
|
|
143
|
+
# characters, each ending in a line break. Like <tt>[bin].pack("m")</tt>
|
|
144
|
+
# by default; with +crlf+, lines end in "\r\n", as MIME requires.
|
|
145
|
+
# RFC 2045 allows lines of up to 76 characters; longer ones are allowed
|
|
146
|
+
# here, as in +pack+, but break the RFC.
|
|
147
|
+
#
|
|
148
|
+
# @param bin [String]
|
|
149
|
+
# @param line_length [Integer] - characters per line, a positive multiple of 4
|
|
150
|
+
# @param crlf [Boolean] - if lines end in "\r\n" instead of "\n"
|
|
151
|
+
# @return [String]
|
|
152
|
+
# @raise [ArgumentError] if +line_length+ is not a positive multiple of 4
|
|
153
|
+
def encode(bin, line_length = 60, crlf: false)
|
|
154
|
+
__encode_rfc_2045(bin, line_length, crlf)
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Returns the Base64-decoded version of +string+, like
|
|
158
|
+
# <tt>string.unpack1("m")</tt>: characters outside the alphabet, such
|
|
159
|
+
# as line breaks, are skipped. Decoding is lenient, as in Ruby, and
|
|
160
|
+
# never raises for malformed input.
|
|
161
|
+
#
|
|
162
|
+
# @param string [String]
|
|
163
|
+
# @return [String]
|
|
164
|
+
def decode(string)
|
|
165
|
+
__decode_rfc_2045(string)
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# Returns the length of {encode} of +bin+.
|
|
169
|
+
#
|
|
170
|
+
# Fast: computed from +bin+'s length.
|
|
171
|
+
#
|
|
172
|
+
# @param bin [String]
|
|
173
|
+
# @param line_length [Integer] - characters per line, a positive multiple of 4
|
|
174
|
+
# @param crlf [Boolean] - if lines end in "\r\n" instead of "\n"
|
|
175
|
+
# @return [Integer]
|
|
176
|
+
# @raise [ArgumentError] if +line_length+ is not a positive multiple of 4
|
|
177
|
+
def encoded_length_of(bin, line_length = 60, crlf: false)
|
|
178
|
+
__encoded_length_of_rfc_2045(bin, line_length, crlf)
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Returns the length of {decode} of +string+.
|
|
182
|
+
#
|
|
183
|
+
# Costly: reads all of +string+, since skipped characters and +=+ decide
|
|
184
|
+
# the length. To size a buffer, <tt>string.bytesize * 3 / 4</tt> is
|
|
185
|
+
# always enough and fast.
|
|
186
|
+
#
|
|
187
|
+
# @param string [String]
|
|
188
|
+
# @return [Integer]
|
|
189
|
+
def decoded_length_of(string)
|
|
190
|
+
__decoded_length_of_rfc_2045(string)
|
|
191
|
+
end
|
|
192
|
+
end
|
|
84
193
|
end
|
|
85
194
|
|
|
86
|
-
#
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
195
|
+
# Methods for uuencoding and -decoding strings.
|
|
196
|
+
module UU
|
|
197
|
+
include Ext
|
|
198
|
+
extend Ext
|
|
199
|
+
|
|
200
|
+
module_function
|
|
201
|
+
|
|
202
|
+
# Returns the uuencoded version of +bin+, like <tt>[bin].pack("u")</tt>:
|
|
203
|
+
# lines of up to 45 input bytes, each ending in a newline.
|
|
204
|
+
#
|
|
205
|
+
# @param bin [String]
|
|
206
|
+
# @return [String]
|
|
207
|
+
def encode(bin)
|
|
208
|
+
__uuencode(bin)
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# Returns the uudecoded version of +string+, like <tt>string.unpack1("u")</tt>.
|
|
212
|
+
# Decoding is lenient, as in Ruby: it stops at the first invalid line and
|
|
213
|
+
# never raises for malformed input.
|
|
214
|
+
#
|
|
215
|
+
# @param string [String]
|
|
216
|
+
# @return [String]
|
|
217
|
+
def decode(string)
|
|
218
|
+
__uudecode(string)
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Returns the length of {encode} of +bin+.
|
|
222
|
+
#
|
|
223
|
+
# Fast: computed from +bin+'s length.
|
|
224
|
+
#
|
|
225
|
+
# @param bin [String]
|
|
226
|
+
# @return [Integer]
|
|
227
|
+
def encoded_length_of(bin)
|
|
228
|
+
__uuencoded_length_of(bin)
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
# Returns the length of {decode} of +string+.
|
|
232
|
+
# Like {decode}, never raises for malformed input.
|
|
233
|
+
#
|
|
234
|
+
# Costly: reads all of +string+, since each line's length character
|
|
235
|
+
# decides the length. To size a buffer, <tt>string.bytesize * 3 / 4</tt>
|
|
236
|
+
# is always enough and fast.
|
|
237
|
+
#
|
|
238
|
+
# @param string [String]
|
|
239
|
+
# @return [Integer]
|
|
240
|
+
def decoded_length_of(string)
|
|
241
|
+
__uudecoded_length_of(string)
|
|
242
|
+
end
|
|
95
243
|
end
|
|
96
244
|
end
|
data/ob64.gemspec
CHANGED
|
@@ -10,15 +10,13 @@ Gem::Specification.new do |spec|
|
|
|
10
10
|
spec.email = ["joao.fernandes@ist.utl.pt"]
|
|
11
11
|
spec.homepage = "https://github.com/jcmfernandes/ob64"
|
|
12
12
|
spec.license = "MIT"
|
|
13
|
-
spec.summary = "A fast Base64 encoder and decoder."
|
|
14
|
-
spec.description = "A fast Base64 encoder and decoder that makes use of SIMD extensions."
|
|
13
|
+
spec.summary = "A fast Base64 and uuencode encoder and decoder."
|
|
14
|
+
spec.description = "A fast Base64 and uuencode encoder and decoder that makes use of SIMD extensions."
|
|
15
15
|
|
|
16
16
|
# Specify which files should be added to the gem when it is released.
|
|
17
17
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
18
18
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
|
19
19
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
|
|
20
|
-
end + Dir.chdir(File.join(File.expand_path(__dir__), "vendor", "libbase64")) do
|
|
21
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }.map! { |f| "vendor/libbase64/#{f}" }
|
|
22
20
|
end
|
|
23
21
|
spec.require_paths = ["lib"]
|
|
24
22
|
spec.extensions = ["ext/ob64/extconf.rb"]
|
|
@@ -30,5 +28,5 @@ Gem::Specification.new do |spec|
|
|
|
30
28
|
"source_code_uri" => spec.homepage + "/tree/v#{spec.version}"
|
|
31
29
|
}
|
|
32
30
|
|
|
33
|
-
spec.required_ruby_version = Gem::Requirement.new(">=
|
|
31
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 3.3.0")
|
|
34
32
|
end
|
metadata
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ob64
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- João Fernandes
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies: []
|
|
13
|
-
description: A fast Base64 encoder and decoder that makes use of SIMD
|
|
12
|
+
description: A fast Base64 and uuencode encoder and decoder that makes use of SIMD
|
|
13
|
+
extensions.
|
|
14
14
|
email:
|
|
15
15
|
- joao.fernandes@ist.utl.pt
|
|
16
16
|
executables: []
|
|
@@ -18,9 +18,9 @@ extensions:
|
|
|
18
18
|
- ext/ob64/extconf.rb
|
|
19
19
|
extra_rdoc_files: []
|
|
20
20
|
files:
|
|
21
|
+
- ".github/dependabot.yml"
|
|
21
22
|
- ".github/workflows/main.yml"
|
|
22
23
|
- ".gitignore"
|
|
23
|
-
- ".gitmodules"
|
|
24
24
|
- ".rspec"
|
|
25
25
|
- ".standard.yml"
|
|
26
26
|
- ".yardopts"
|
|
@@ -35,86 +35,32 @@ files:
|
|
|
35
35
|
- bin/_guard-core
|
|
36
36
|
- bin/console
|
|
37
37
|
- bin/guard
|
|
38
|
+
- bin/rake
|
|
38
39
|
- bin/rspec
|
|
39
40
|
- bin/setup
|
|
40
41
|
- bin/standardrb
|
|
41
42
|
- ext/ob64/extconf.rb
|
|
42
|
-
- ext/ob64/libbase64.h
|
|
43
43
|
- ext/ob64/ob64.h
|
|
44
44
|
- ext/ob64/ob64_ext.c
|
|
45
|
+
- ext/ob64/ob64_pack.c
|
|
46
|
+
- ext/ob64/pack_base64.c
|
|
47
|
+
- ext/ob64/pack_base64.h
|
|
48
|
+
- ext/ob64/pack_generic.h
|
|
49
|
+
- ext/ob64/pack_simd.h
|
|
50
|
+
- ext/ob64/pack_uuencode.c
|
|
51
|
+
- ext/ob64/pack_uuencode.h
|
|
45
52
|
- lib/ob64.rb
|
|
46
53
|
- lib/ob64/core_ext.rb
|
|
47
54
|
- lib/ob64/version.rb
|
|
48
55
|
- ob64.gemspec
|
|
49
|
-
- vendor/libbase64/.gitignore
|
|
50
|
-
- vendor/libbase64/.travis.yml
|
|
51
|
-
- vendor/libbase64/CMakeLists.txt
|
|
52
|
-
- vendor/libbase64/LICENSE
|
|
53
|
-
- vendor/libbase64/Makefile
|
|
54
|
-
- vendor/libbase64/README.md
|
|
55
|
-
- vendor/libbase64/base64-benchmarks.png
|
|
56
|
-
- vendor/libbase64/bin/base64.c
|
|
57
|
-
- vendor/libbase64/cmake/Modules/TargetArch.cmake
|
|
58
|
-
- vendor/libbase64/cmake/Modules/TargetSIMDInstructionSet.cmake
|
|
59
|
-
- vendor/libbase64/cmake/base64-config.cmake.in
|
|
60
|
-
- vendor/libbase64/cmake/config.h.in
|
|
61
|
-
- vendor/libbase64/cmake/test-arch.c
|
|
62
|
-
- vendor/libbase64/include/libbase64.h
|
|
63
|
-
- vendor/libbase64/lib/arch/avx/codec.c
|
|
64
|
-
- vendor/libbase64/lib/arch/avx2/codec.c
|
|
65
|
-
- vendor/libbase64/lib/arch/avx2/dec_loop.c
|
|
66
|
-
- vendor/libbase64/lib/arch/avx2/dec_reshuffle.c
|
|
67
|
-
- vendor/libbase64/lib/arch/avx2/enc_loop.c
|
|
68
|
-
- vendor/libbase64/lib/arch/avx2/enc_reshuffle.c
|
|
69
|
-
- vendor/libbase64/lib/arch/avx2/enc_translate.c
|
|
70
|
-
- vendor/libbase64/lib/arch/generic/32/dec_loop.c
|
|
71
|
-
- vendor/libbase64/lib/arch/generic/32/enc_loop.c
|
|
72
|
-
- vendor/libbase64/lib/arch/generic/64/enc_loop.c
|
|
73
|
-
- vendor/libbase64/lib/arch/generic/codec.c
|
|
74
|
-
- vendor/libbase64/lib/arch/generic/dec_head.c
|
|
75
|
-
- vendor/libbase64/lib/arch/generic/dec_tail.c
|
|
76
|
-
- vendor/libbase64/lib/arch/generic/enc_head.c
|
|
77
|
-
- vendor/libbase64/lib/arch/generic/enc_tail.c
|
|
78
|
-
- vendor/libbase64/lib/arch/neon32/codec.c
|
|
79
|
-
- vendor/libbase64/lib/arch/neon32/dec_loop.c
|
|
80
|
-
- vendor/libbase64/lib/arch/neon32/enc_loop.c
|
|
81
|
-
- vendor/libbase64/lib/arch/neon32/enc_reshuffle.c
|
|
82
|
-
- vendor/libbase64/lib/arch/neon32/enc_translate.c
|
|
83
|
-
- vendor/libbase64/lib/arch/neon64/codec.c
|
|
84
|
-
- vendor/libbase64/lib/arch/neon64/dec_loop.c
|
|
85
|
-
- vendor/libbase64/lib/arch/neon64/enc_loop.c
|
|
86
|
-
- vendor/libbase64/lib/arch/neon64/enc_reshuffle.c
|
|
87
|
-
- vendor/libbase64/lib/arch/sse41/codec.c
|
|
88
|
-
- vendor/libbase64/lib/arch/sse42/codec.c
|
|
89
|
-
- vendor/libbase64/lib/arch/ssse3/codec.c
|
|
90
|
-
- vendor/libbase64/lib/arch/ssse3/dec_loop.c
|
|
91
|
-
- vendor/libbase64/lib/arch/ssse3/dec_reshuffle.c
|
|
92
|
-
- vendor/libbase64/lib/arch/ssse3/enc_loop.c
|
|
93
|
-
- vendor/libbase64/lib/arch/ssse3/enc_reshuffle.c
|
|
94
|
-
- vendor/libbase64/lib/arch/ssse3/enc_translate.c
|
|
95
|
-
- vendor/libbase64/lib/codec_choose.c
|
|
96
|
-
- vendor/libbase64/lib/codecs.h
|
|
97
|
-
- vendor/libbase64/lib/env.h
|
|
98
|
-
- vendor/libbase64/lib/exports.txt
|
|
99
|
-
- vendor/libbase64/lib/lib.c
|
|
100
|
-
- vendor/libbase64/lib/lib_openmp.c
|
|
101
|
-
- vendor/libbase64/lib/tables/.gitignore
|
|
102
|
-
- vendor/libbase64/lib/tables/Makefile
|
|
103
|
-
- vendor/libbase64/lib/tables/table_dec_32bit.h
|
|
104
|
-
- vendor/libbase64/lib/tables/table_enc_12bit.h
|
|
105
|
-
- vendor/libbase64/lib/tables/table_enc_12bit.py
|
|
106
|
-
- vendor/libbase64/lib/tables/table_generator.c
|
|
107
|
-
- vendor/libbase64/lib/tables/tables.c
|
|
108
|
-
- vendor/libbase64/lib/tables/tables.h
|
|
109
56
|
homepage: https://github.com/jcmfernandes/ob64
|
|
110
57
|
licenses:
|
|
111
58
|
- MIT
|
|
112
59
|
metadata:
|
|
113
60
|
homepage_uri: https://github.com/jcmfernandes/ob64
|
|
114
61
|
changelog_uri: https://github.com/jcmfernandes/ob64/blob/master/CHANGELOG.md
|
|
115
|
-
documentation_uri: https://www.rubydoc.info/gems/ob64/0.
|
|
116
|
-
source_code_uri: https://github.com/jcmfernandes/ob64/tree/v0.
|
|
117
|
-
post_install_message:
|
|
62
|
+
documentation_uri: https://www.rubydoc.info/gems/ob64/0.7.0
|
|
63
|
+
source_code_uri: https://github.com/jcmfernandes/ob64/tree/v0.7.0
|
|
118
64
|
rdoc_options: []
|
|
119
65
|
require_paths:
|
|
120
66
|
- lib
|
|
@@ -122,15 +68,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
122
68
|
requirements:
|
|
123
69
|
- - ">="
|
|
124
70
|
- !ruby/object:Gem::Version
|
|
125
|
-
version:
|
|
71
|
+
version: 3.3.0
|
|
126
72
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
73
|
requirements:
|
|
128
74
|
- - ">="
|
|
129
75
|
- !ruby/object:Gem::Version
|
|
130
76
|
version: '0'
|
|
131
77
|
requirements: []
|
|
132
|
-
rubygems_version:
|
|
133
|
-
signing_key:
|
|
78
|
+
rubygems_version: 4.0.23
|
|
134
79
|
specification_version: 4
|
|
135
|
-
summary: A fast Base64 encoder and decoder.
|
|
80
|
+
summary: A fast Base64 and uuencode encoder and decoder.
|
|
136
81
|
test_files: []
|
data/.gitmodules
DELETED
data/ext/ob64/libbase64.h
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
#include "../../vendor/libbase64/include/libbase64.h"
|
data/vendor/libbase64/.gitignore
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
language: c
|
|
2
|
-
services: docker
|
|
3
|
-
|
|
4
|
-
jobs:
|
|
5
|
-
allow_failures:
|
|
6
|
-
- os: osx
|
|
7
|
-
- arch: ppc64le
|
|
8
|
-
|
|
9
|
-
include:
|
|
10
|
-
- name: linux-amd64-gcc
|
|
11
|
-
os: linux
|
|
12
|
-
arch: amd64
|
|
13
|
-
compiler: gcc
|
|
14
|
-
script: test/ci/amd64.sh
|
|
15
|
-
|
|
16
|
-
- name: linux-amd64-gcc +openmp
|
|
17
|
-
os: linux
|
|
18
|
-
arch: amd64
|
|
19
|
-
compiler: gcc
|
|
20
|
-
env: OPENMP=1 OMP_NUM_THREADS=4
|
|
21
|
-
script: test/ci/amd64.sh
|
|
22
|
-
|
|
23
|
-
- name: linux-amd64-clang
|
|
24
|
-
os: linux
|
|
25
|
-
arch: amd64
|
|
26
|
-
compiler: clang
|
|
27
|
-
script: test/ci/amd64.sh
|
|
28
|
-
|
|
29
|
-
- name: linux-arm32-gcc
|
|
30
|
-
compiler: gcc
|
|
31
|
-
script: test/ci/docker-arm32.sh
|
|
32
|
-
|
|
33
|
-
- name: linux-arm32-clang
|
|
34
|
-
compiler: clang
|
|
35
|
-
script: test/ci/docker-arm32.sh
|
|
36
|
-
|
|
37
|
-
- name: linux-powerpc-gcc
|
|
38
|
-
compiler: gcc
|
|
39
|
-
script: test/ci/docker-powerpc.sh
|
|
40
|
-
|
|
41
|
-
- name: linux-arm64-gcc
|
|
42
|
-
os: linux
|
|
43
|
-
arch: arm64
|
|
44
|
-
compiler: gcc
|
|
45
|
-
env: NEON64_CFLAGS="-march=armv8-a"
|
|
46
|
-
script: test/ci/generic.sh
|
|
47
|
-
|
|
48
|
-
- name: linux-arm64-clang
|
|
49
|
-
os: linux
|
|
50
|
-
arch: arm64
|
|
51
|
-
compiler: clang
|
|
52
|
-
env: NEON64_CFLAGS="-march=armv8-a"
|
|
53
|
-
script: test/ci/generic.sh
|
|
54
|
-
|
|
55
|
-
- name: linux-s390x-gcc
|
|
56
|
-
os: linux
|
|
57
|
-
arch: s390x
|
|
58
|
-
compiler: gcc
|
|
59
|
-
script: test/ci/generic.sh
|
|
60
|
-
|
|
61
|
-
- name: linux-ppc64le-gcc
|
|
62
|
-
os: linux
|
|
63
|
-
arch: ppc64le
|
|
64
|
-
compiler: gcc
|
|
65
|
-
script: test/ci/generic.sh
|
|
66
|
-
|
|
67
|
-
- name: osx-amd64-clang
|
|
68
|
-
os: osx
|
|
69
|
-
arch: amd64
|
|
70
|
-
compiler: clang
|
|
71
|
-
script: test/ci/amd64.sh
|