Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int seed;
- const m = 2^32;
- const a = 1103515245;
- const c = 12345;
- static const int lol [] = {
- 18174815, 96181712, 19668646, 36117134, 51896631,
- 05220411, 89512542, 81114199, 18467242, 69642758,
- 95646984, 52559481, 45511439, 16981116, 81171454,
- 76387966, 37892947, 28813927, 93667962, 11718768,
- 66667497, 41837727, 31878474, 11362985, 41210687,
- 88978305, 24869181, 92453457, 15114965, 62775711,
- 13477844, 87148176, 14651746, 81768418, 16519841,
- 47981476, 76549746, 12095239, 81768416, 98165165,
- 98441332, 63219816, 76514987, 97654174, 51474749,
- 23189789, 38265928, 32421523, 78417646, 71812598
- };
- int rand () {
- seed = (a * seed + c) % m;
- return seed;
- }
- void TestMD5 () {
- let arr = new ("TZK_ArrayI32");
- int totalMD5Time = 0;
- int startTime = MSTime ();
- for (int i = 0; i < lol.Size (); i++) {
- arr.Clear ();
- seed = lol [i];
- for (int j = 0; j < (64*1024) / 4; j++) {
- int v = rand ();
- Arr.Push ( v & 0xFF);
- Arr.Push ((v >>> 8*1) & 0xFF);
- Arr.Push ((v >>> 8*2) & 0xFF);
- Arr.Push ((v >>> 8*3) & 0xFF);
- }
- int MD5StartTime = MSTime ();
- string md5 = S7_MD5.FromBytes (arr);
- totalMD5Time += MSTime () - MD5StartTime;
- Console.PrintF ("%s", md5);
- }
- int endTime = MSTime ();
- Console.PrintF ("total time: %d\ntotal MD5 time: %d", endTime - startTime, totalMD5Time);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement