lib/api_auth/helpers.rb in api-auth-2.1.0 vs lib/api_auth/helpers.rb in api-auth-2.2.0
- old
+ new
@@ -1,21 +1,12 @@
module ApiAuth
module Helpers # :nodoc:
def b64_encode(string)
- if Base64.respond_to?(:strict_encode64)
- Base64.strict_encode64(string)
- else
- # Fall back to stripping out newlines on Ruby 1.8.
- Base64.encode64(string).delete("\n")
- end
+ Base64.strict_encode64(string)
end
def md5_base64digest(string)
- if Digest::MD5.respond_to?(:base64digest)
- Digest::MD5.base64digest(string)
- else
- b64_encode(Digest::MD5.digest(string))
- end
+ Digest::MD5.base64digest(string)
end
# Capitalizes the keys of a hash
def capitalize_keys(hsh)
capitalized_hash = {}