lib/ob64.rb in ob64-0.2.0 vs lib/ob64.rb in ob64-0.3.0
- old
+ new
@@ -3,10 +3,13 @@
require_relative "ob64/version"
require_relative "ob64_ext"
# Methods for base64-encoding and -decoding strings.
module Ob64
+ # The glue between Ruby and libbase64. See +../ext/libbase64/ob64/ob64_ext.c+.
+ module LibBase64; end
+
include LibBase64
extend LibBase64
module_function
@@ -72,19 +75,22 @@
end
# Returns the length of the Base64-encoded version of +bin+.
#
# @param bin [String]
- # @param paddding [Boolean] - if the Base64-encoded version of +bin+ will be padded
+ # @param padding [Boolean] - if the Base64-encoded version of +bin+ will be padded
# @return [Integer]
def encoded_length_of(bin, padding: true)
__encoded_length_of(bin, padding)
end
# Returns the length of the Base64-decoded version of +string+.
#
+ # ArgumentError is raised if +string+ has an invalid length.
+ #
# @param string [String]
# @return [Integer]
+ # @raise [ArgumentError] if +string+ has an invalid length
def decoded_length_of(string)
__decoded_length_of(string)
end
end