Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// <summary>A secure int which is hard to change using a program like Poke.</summary>
- struct secint {
- //public int key { get { return _key; } }
- public int value {
- get { return _value ^ _key; }
- set {
- _key = rng.Next(0, int.MaxValue);
- _value = value ^ _key;
- }
- }
- private System.Random rng;
- private int _key;
- private int _value;
- public secint(int val) {
- rng = new System.Random();
- _key = rng.Next(0, int.MaxValue);
- _value = val ^ _key;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement