base64url 1.0.0 → 1.0.1
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.
- data/lib/base64url.rb +23 -1
- metadata +1 -1
data/lib/base64url.rb
CHANGED
@@ -1,4 +1,26 @@
|
|
1
|
-
#
|
1
|
+
#
|
2
|
+
# = base64url.rb: methods for base64url-encoding and -decoding strings
|
3
|
+
#
|
4
|
+
|
5
|
+
# The Base64URL module provides for the encoding and decoding of binary data
|
6
|
+
# using a base64url representation.
|
7
|
+
#
|
8
|
+
# base64url encoding is Base64 for URLs and filenames.
|
9
|
+
# base64url's 62nd and 63rd chars are '-' and '_'.
|
10
|
+
# base64url does not have pad chars '='.
|
11
|
+
#
|
12
|
+
# == Example
|
13
|
+
#
|
14
|
+
# A simple encoding and decoding.
|
15
|
+
#
|
16
|
+
# require "base64url"
|
17
|
+
#
|
18
|
+
# enc = Base64URL.encode('Send reinforcements')
|
19
|
+
# # -> "U2VuZCByZWluZm9yY2VtZW50cw"
|
20
|
+
# plain = Base64URL.decode(enc)
|
21
|
+
# # -> "Send reinforcements"
|
22
|
+
#
|
23
|
+
|
2
24
|
module Base64URL
|
3
25
|
module_function
|
4
26
|
|