Кастомный рандом нужен, если требуется защита от атак по времени. Если бы автор замутил аналог OpenSSL random, в этом был бы какой-то смысл (например, генерация токенов), а так просто научная работа =)
If we are using the trivial TYPE_0 R.N.G., just do the old linear
congruential bit. Otherwise, we do our fancy trinomial stuff, which is the
same in all the other cases due to all the global variables that have been
set up. The basic operation is to add the number at the rear pointer into
the one at the front pointer. Then both pointers are advanced to the next
location cyclically in the table. The value returned is the sum generated,
reduced to 31 bits by throwing away the "least random" low bit.
Note: The code takes advantage of the fact that both the front and
rear pointers can't wrap on the same call by not testing the rear
pointer if the front one has wrapped. Returns a 31-bit random number.
» Мир безумного / Overwatch мастерская
» Мир безумного / Overwatch мастерская
» Прочее / Главный вопрос жизни, вселенной и всего такого
» Администрация XGM / Раздел - Прочие вопросы
» WarCraft 3 / S.T.A.L.K.E.R GANG WAR
» WarCraft 3 / S.T.A.L.K.E.R GANG WAR
Предлагаю заюзать материалы из jc project
» WarCraft 3 / Один ключ для локалки
Ред. ScorpioT1000
» WarCraft 3 / Безоружный Король-Лич
» Администрация XGM / Отображение активности
когда ты не в сети
Ред. ScorpioT1000
» Администрация XGM / Agren и компания
» Администрация XGM / Agren и компания
» WarCraft 3 / Генератор псевдослучайных чисел
В комменты все пишут, потому что все около-айти, а айтишных вещей на сайте появляется сейчас мало
Ред. ScorpioT1000
» WarCraft 3 / Генератор псевдослучайных чисел
» WarCraft 3 / Генератор псевдослучайных чисел
congruential bit. Otherwise, we do our fancy trinomial stuff, which is the
same in all the other cases due to all the global variables that have been
set up. The basic operation is to add the number at the rear pointer into
the one at the front pointer. Then both pointers are advanced to the next
location cyclically in the table. The value returned is the sum generated,
reduced to 31 bits by throwing away the "least random" low bit.
Note: The code takes advantage of the fact that both the front and
rear pointers can't wrap on the same call by not testing the rear
pointer if the front one has wrapped. Returns a 31-bit random number.
» Администрация XGM / Топ блогов не работает
» Администрация XGM / Лейба о файлах комментария
» Администрация XGM / Agren и компания
» Администрация XGM / Agren и компания
» Администрация XGM / Agren и компания
https://www.xgm.guru/user/17654
Ред. ScorpioT1000
» TcX / Как начать играть в TcX с нуля
» Администрация XGM / Битая ссылка в списке проектов
» Администрация XGM / Битая ссылка в списке проектов
Это, как обычно, магия хардкода какая-то
» Администрация XGM / Топ блогов не работает