Sha256: 8d3d31f64b7d47060b65aeca7f382c7d383cb18dcbd002e7d3964a79a7d9572d

Contents?: true

Size: 271 Bytes

Versions: 10

Compression:

Stored size: 271 Bytes

Contents

module DynamicPaperclip
  module UrlSecurity
    def self.generate_hash(style_name)
      Digest::SHA1.hexdigest "#{DynamicPaperclip.config.secret}#{style_name}"
    end

    def self.valid_hash?(hash, style_name)
      generate_hash(style_name) == hash
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
dynamic_paperclip-1.0.1 lib/dynamic_paperclip/url_security.rb
dynamic_paperclip-1.0.0 lib/dynamic_paperclip/url_security.rb
dynamic_paperclip-1.0.0.alpha.4 lib/dynamic_paperclip/url_security.rb
dynamic_paperclip-1.0.0a.3 lib/dynamic_paperclip/url_security.rb
dynamic_paperclip-1.0.0a.2 lib/dynamic_paperclip/url_security.rb
dynamic_paperclip-1.0.0a.1 lib/dynamic_paperclip/url_security.rb
dynamic_paperclip-0.0.4 lib/dynamic_paperclip/url_security.rb
dynamic_paperclip-0.0.3 lib/dynamic_paperclip/url_security.rb
dynamic_paperclip-0.0.2 lib/dynamic_paperclip/url_security.rb
dynamic_paperclip-0.0.1 lib/dynamic_paperclip/url_security.rb