def fingerprint
      h = Digest::SHA2.new
      h << (self.exclusive ? 'true' : 'false')

      users = self.users.sort { |a, b| a.uuid <=> b.uuid }
      users.each do |u|
        h << format(",(%d,%s,%s,%d,%s",
                    u.uuid, u.common_name,
                    (u.superuser ? 'true' : 'false'),
                    (u.expires_at ? u.expires_at.to_i : 0),
                    u.username)

        u.public_key_fingerprints.each do |fp|
          h << "," << fp
        end
        h << ')'
      end

      h.hexdigest
    end
def fingerprint
      h = Digest::SHA2.new
      h << (self.exclusive ? 'true' : 'false')

      users = self.users.sort { |a, b| a.uuid <=> b.uuid }
      users.each do |u|
        h << format(",(%d,%s,%s,%d,%s",
                    u.uuid, u.common_name,
                    (u.superuser ? 'true' : 'false'),
                    (u.expires_at ? u.expires_at.to_i : 0),
                    u.username)

        u.public_key_fingerprints.each do |fp|
          h << "," << fp
        end
        h << ')'
      end

      h.hexdigest
    end
Compute a cryptographic hash of the information in this policy; helps
 callers compare two policies to see if they are equivalent.
 @see https://github.com/rightscale/cmaro/domain/login_policy.go