diff --git a/spec/support/js_helpers.rb b/spec/support/js_helpers.rb index 6753b00..cf1c0e5 100644 --- a/spec/support/js_helpers.rb +++ b/spec/support/js_helpers.rb @@ -3,7 +3,6 @@ require "mini_racer" require "json" require "digest" -require "base64" module JsHelpers def js_ctx @@ -38,7 +37,7 @@ def js_estimate_guesses(match, password) end def cached_eval(js_str) - tmp_hash = Base64.urlsafe_encode64 Digest::MD5.digest(js_str.to_s), padding: false + tmp_hash = Digest::MD5.hexdigest(js_str.to_s) cache_name = Pathname(File.expand_path("../../../tmp/#{tmp_hash}.json", __FILE__)) if File.exist?(cache_name) JSON.parse(File.read(cache_name))