Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Extract explaining method
  • Loading branch information
dhh committed Jul 4, 2017
1 parent d7e877b commit a146858
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/active_file/sites/gcs_site.rb
Expand Up @@ -32,12 +32,16 @@ def byte_size(key)
end

def checksum(key)
file_for(key).md5.unpack("m0").first.unpack("H*").first
convert_to_hex base64: file_for(key).md5
end


private
def file_for(key)
bucket.file(key)
end

def convert_to_hex(base64:)
base64.unpack("m0").first.unpack("H*").first
end
end

0 comments on commit a146858

Please sign in to comment.