Skip to content
This repository has been archived by the owner on Oct 26, 2018. It is now read-only.

Commit

Permalink
Switch MD5 implementation to use Ruby native stdlib vs. shelling out …
Browse files Browse the repository at this point in the history
…to openssl. Native MD5 is approx 25x faster: http://gist.github.com/546499.
  • Loading branch information
Winfield Peterson authored and Menno van der Sman committed Oct 2, 2010
1 parent d81ebd3 commit 0093c46
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/cloudfront_asset_host.rb
@@ -1,3 +1,4 @@
require 'digest/md5'
require 'cloudfront_asset_host/asset_tag_helper_ext'

module CloudfrontAssetHost
Expand Down Expand Up @@ -106,7 +107,7 @@ def properly_configured?
end

def md5sum(path)
`openssl md5 #{path}`.split(/\s/)[1].to_s
Digest::MD5.hexdigest(File.read(path))
end

end
Expand Down

0 comments on commit 0093c46

Please sign in to comment.