Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

random function in solidity

function random() private view returns(uint){
  uint source = block.difficulty + now;
  bytes memory source_b = toBytes(source);
  return uint(keccak256(source_b)) % 100;	
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #random #function #solidity
ADD COMMENT
Topic
Name
5+9 =