Class: Paperdragon::Paperclip::Uid::HashKey

Inherits:
Object
  • Object
show all
Defined in:
lib/paperdragon/paperclip.rb

Overview

“:class/:attachment/:id/:style/:updated_at”

Class Method Summary collapse

Class Method Details

.call(secret, class_name, attachment, id, style, updated_at) ⇒ Object

cover_girls/images/4841/thumb/1402617353



58
59
60
61
62
# File 'lib/paperdragon/paperclip.rb', line 58

def self.call(secret, class_name, attachment, id, style, updated_at)
  data = "#{class_name}/#{attachment}/#{id}/#{style}/#{updated_at}"
  # puts "[Paperdragon] HashKey <--------------------- #{data}"
  OpenSSL::HMAC.hexdigest(OpenSSL::Digest::SHA1.new, secret, data)
end