Skip to content

Commit

Permalink
stop using base64
Browse files Browse the repository at this point in the history
  • Loading branch information
formigarafa committed Jan 4, 2025
1 parent e2878b2 commit fd74e31
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions spec/support/js_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
require "mini_racer"
require "json"
require "digest"
require "base64"

module JsHelpers
def js_ctx
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit fd74e31

Please sign in to comment.