SmartFoxServer 2X C++ API
Sfs2X::Util::PasswordUtil Class Reference

Helper class for logging in with a pre-hashed password More...

#include <PasswordUtil.h>

Static Public Member Functions

static boost::shared_ptr< string > MD5Password (string pass)
 Generates the MD5 hash of the user password. More...
 

Detailed Description

Helper class for logging in with a pre-hashed password

This is needed if your server-side database stores User passwords hashed with MD5. For more information see the Sign Up Assistant component tutorial

(Password Mode section).

Member Function Documentation

◆ MD5Password()

boost::shared_ptr< string > Sfs2X::Util::PasswordUtil::MD5Password ( string  pass)
static

Generates the MD5 hash of the user password.

Parameters
passThe plain text password.
Returns
The hashed password.
string userName = "testName";
string userPass = "testPass";
boost::shared_ptr<string> md5Pass = PasswordUtil.MD5Password(userPass);
boost::shared_ptr<IRequest> request (new LoginRequest(userName, *md5Pass));
ptrSmartFox->Send(request);