git-svn-id: svn://db.shs.com.ru/pip@655 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2018-10-24 07:33:11 +00:00
parent 98399b08f8
commit 1f0810ab1e
2 changed files with 12 additions and 0 deletions

View File

@@ -394,6 +394,15 @@ PIByteArray PICrypt::passwordHash(const PIString & password, const PIByteArray &
} }
PIString PICrypt::version() {
#ifdef PIP_CRYPT
return SODIUM_VERSION_STRING;
#else
return PIString();
#endif
}
bool PICrypt::init() { bool PICrypt::init() {
#ifdef PIP_CRYPT #ifdef PIP_CRYPT
static bool inited = false; static bool inited = false;

View File

@@ -102,6 +102,9 @@ public:
//! Generate password hash from "password" //! Generate password hash from "password"
static PIByteArray passwordHash(const PIString & password, const PIByteArray & seed); static PIByteArray passwordHash(const PIString & password, const PIByteArray & seed);
//! Returns libsodium version
static PIString version();
private: private:
static bool init(); static bool init();