Skip to content
Browse files

Switch MD5 implementation to use Ruby native stdlib vs. shelling out …

…to openssl. Native MD5 is approx 25x faster: http://gist.github.com/546499.
  • Loading branch information...
1 parent d81ebd3 commit 0093c46ce144911600f1fdafca1e1c650865ab7e Winfield Peterson committed with
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/cloudfront_asset_host.rb
View
3 lib/cloudfront_asset_host.rb
@@ -1,3 +1,4 @@
+require 'digest/md5'
require 'cloudfront_asset_host/asset_tag_helper_ext'
module CloudfrontAssetHost
@@ -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

0 comments on commit 0093c46

Please sign in to comment.
Something went wrong with that request. Please try again.