ToBytes Function In Solidity

[Solved] ToBytes Function In Solidity | Solidity - Code Explorer | yomemimo.com
Question : toBytes function in solidity

Answered by : dejan-ilic

function toBytes(uint256 x) private pure returns (bytes memory b) { b = new bytes(32); assembly { mstore(add(b, 32), x) }
}

Source : | Last Update : Wed, 15 Jun 22

Answers related to toBytes function in solidity

Code Explorer Popular Question For Solidity