Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- contract InsecureRandomGenerator {
- bytes32 public randseed;
- function pseudoRandom(uint start, uint end)
- returns (uint) {
- randseed = keccak256(randseed, block.timestamp,
- block.blockhash(block.number-1), block.coinbase,
- block.difficulty, block.number);
- uint range = end - start + 1;
- uint randVal = start + uint256(randseed) % range;
- return randVal;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement