+ def self.upgrade?(hash, salt)
+ if salt.nil?
+ return true
+ elsif salt.include?("!")
+ algorithm, iterations, salt = salt.split("!")
+ return true if Base64.strict_decode64(salt).length != SALT_BYTE_SIZE
+ return true if Base64.strict_decode64(hash).length != HASH_BYTE_SIZE
+ return true if iterations.to_i != PBKDF2_ITERATIONS
+ return true if algorithm != DIGEST_ALGORITHM
+ else
+ return true
+ end
+
+ false
+ end