Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
 
unsigned long rol (unsigned long iNum, int n = 1)
{
	return (iNum << n) | (iNum >> (8 * sizeof(iNum) - n)); 
}
 
unsigned long GenNumForName (std::string x)
{
	unsigned long j = 0;
 
	for (size_t i = 0; i < x.size(); ++i) 
	{
		j = (((x[i] * rol(j + x[i])) + x[i]) ^ x[i]);
	}
 
	return (((~j) + 0xBADC0DE5) ^ 0x1337C0DE);
}
quelqu'un m'explique cela