module Auth

Public Class Methods

authentic?(entity, pwd) click to toggle source
# File lib/auth.rb, line 10
def self.authentic?(entity, pwd)
  entity['signature'] == signature(entity['id'], pwd)
end
signature(id, pwd) click to toggle source
# File lib/auth.rb, line 6
def self.signature(id, pwd)
  Base64.strict_encode64(Defaults::CRYPTOHASH.digest("#{id},#{pwd}"))
end