Use unpack1
instead of unpack
and first
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
07b88b2616
commit
97795849e4
@ -56,7 +56,7 @@ module Base64
|
||||
# This is line three
|
||||
# And so on...
|
||||
def decode64(str)
|
||||
str.unpack("m").first
|
||||
str.unpack1("m")
|
||||
end
|
||||
|
||||
# Returns the Base64-encoded version of +bin+.
|
||||
@ -71,7 +71,7 @@ module Base64
|
||||
# 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
|
||||
str.unpack1("m0")
|
||||
end
|
||||
|
||||
# Returns the Base64-encoded version of +bin+.
|
||||
|
Loading…
x
Reference in New Issue
Block a user