app/models/user.rb
# calc sha256 from SystemParameter.secret and user info
calc sha256 from SystemParameter.secret and user info
calc sha256 from SystemParameter . secret and user info
def calc_sha256 (secret)
    return nil if dummy_user?
    if provider == 'facebook'
      sha256_input = "#{secret},#{self.api_profile_picture_url}/#{self.provider},#{self.user_name}"
    else
      sha256_input = "#{secret},#{self.uid}/#{self.provider},#{self.user_name}"
    end
    Base64.encode64(Digest::SHA256.digest(sha256_input)).gsub(/\n$/,'') 
  end
def calc_sha256 ( secret ) return nil if dummy_user? if provider == 'facebook' sha256_input = "#{secret},#{self.api_profile_picture_url}/#{self.provider},#{self.user_name}" else sha256_input = "#{secret},#{self.uid}/#{self.provider},#{self.user_name}" end Base64 . encode64 ( Digest :: SHA256 . digest ( sha256_input ) ) . gsub ( / \n $ / , '' ) end
calc sha256 from SystemParameter.secret and user info
calc sha256 from SystemParameter . secret and user info
# uid cannot be used as global id for fb users. different uid f # remove last /n - used as hash key in JS
secret
<not_specific>