Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- unsigned short RNG64(unsigned short input){
- unsigned short S0 = (input & 0xFF) << 8;
- S0 ^= input;
- input = (S0 << 8) + (S0 >> 8);
- S0 = input ^ ((S0 & 0xFF) << 1);
- unsigned short S1 = (0xFF80 ^ (S0 >> 1));
- return S0 & 1 ? S1 ^ 0x8180 : S1 ^ 0x1FF4;
- }
- unsigned short RNGWrapper(){
- static unsigned short StoredInput=0;
- StoredInput = RNG64(StoredInput);
- return StoredInput;
- }
- int main(){
- for (int i = 0; i < 50; i++){
- std::cout << RNGWrapper() << std::endl;
- }
- system("PAUSE>NUL");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement