#include "auth.h"

#include <library/cpp/digest/md5/md5.h>
#include <util/string/cast.h>

using namespace NSaas;

TString TAuthorization::GetAuthCookie(const TString& service, ui64 prefix) const {
    return MD5::Calc(KeyWord + MD5::Calc(service + " " + ToString(prefix)));
}

NSaas::TAuthorization::TAuthorization(const TString& salt)
    : KeyWord(salt)
{}
