Skip to content

Commit

Permalink
Revert "Use unpack1 instead of unpack and first"
Browse files Browse the repository at this point in the history
This reverts commit 020811c.
  • Loading branch information
hsbt committed Oct 16, 2024
1 parent b9e23b2 commit ad57ed3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/base64.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def encode64(bin)
# This is line three
# And so on...
def decode64(str)
str.unpack1("m")
str.unpack("m").first
end

# Returns the Base64-encoded version of +bin+.
Expand All @@ -71,7 +71,7 @@ def strict_encode64(bin)
# 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.unpack1("m0")
str.unpack("m0").first
end

# Returns the Base64-encoded version of +bin+.
Expand Down

0 comments on commit ad57ed3

Please sign in to comment.