How to generate a random number in solidity?
问题 I have a couple of keccaks, which could be reduced to one, if I would find a cheap way to get parts of the created uint. pragma solidity ^0.4.19; contract test { function test() { } function sup() returns (uint test) { uint _test = uint(keccak256("wow")); return _test; } } This returns me a sweet random number: 13483274892375982735325 Now the plan is that instead of calling keccak 5 times with different "seeds", I could take that number apart and get something like: 1348, 3274, 8923 etc.