#include <../arch/arch.h>

void	V_CALL
archUniqueString(char *buf,vsize_t buffer_size)
{
	u32_t mask;
	ran_state_t rs;
	DWORD pid = GetCurrentProcessId();
	buf[--buffer_size] = 0;
	timeDelay(1);
	ranInitState(&rs,timeTickCount());
	mask = (pid + (pid >> 4) + (pid >> 8) + (pid >> 16)) & 0xF;
	for(;buffer_size;buffer_size--,buf++)
		*buf = nibble2HexChar((u8_t)(ranGenerateNext(&rs) ^ mask));
}
