/*
								+-----------------------------------+
								|                                   |
								|  ***  Auth / security utils  ***  |
								|                                   |
								|   Copyright  © -tHE SWINe- 2015   |
								|                                   |
								|           AuthUtils.cpp           |
								|                                   |
								+-----------------------------------+
*/

/**
 *	@file AuthUtils.cpp
 *	@brief authentication and security utilities
 *	@author -tHE SWINe-
 *	@date 2015-03-21
 */

#include "AuthUtils.h"

/*
 *								=== ~platform utils ===
 */

#if defined(_WIN32) || defined(_WIN64)

// ...

#else // _WIN32 || _WIN64

//#include <random.h> // unix random generator (don't have?)

#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <time.h>
#include <unistd.h> // sleep()

static void Sleep(int n_millis)
{
	struct timespec t_time;
	memset(&t_time, 0, sizeof(t_time));
	t_time.tv_sec = n_millis / 1000;
	t_time.tv_nsec = (n_millis % 1000) * 1000000;
	nanosleep(&t_time, NULL);
}

#endif // _WIN32 || _WIN64

/*
 *								=== ~platform utils ===
 */
