lib/symmetric_encryption/cipher.rb in symmetric-encryption-4.3.2 vs lib/symmetric_encryption/cipher.rb in symmetric-encryption-4.3.3

- old
+ new

@@ -82,13 +82,13 @@ @cipher_name = cipher_name self.encoding = encoding.to_sym @version = version.to_i @always_add_header = always_add_header - if (@version > 255) || @version.negative? - raise(ArgumentError, "Cipher version has a valid range of 0 to 255. #{@version} is too high, or negative") - end + return unless (@version > 255) || @version.negative? + + raise(ArgumentError, "Cipher version has a valid range of 0 to 255. #{@version} is too high, or negative") end # Change the encoding def encoding=(encoding) @encoder = nil @@ -112,10 +112,10 @@ # str [String] # String to be encrypted. If str is not a string, #to_s will be called on it # to convert it to a string # # random_iv [true|false] - # Whether the encypted value should use a random IV every time the + # Whether the encrypted value should use a random IV every time the # field is encrypted. # Notes: # * Setting random_iv to true will result in a different encrypted output for # the same input string. # * It is recommended to set this to true, except if it will be used as a lookup key.