Arachnid / solidity-stringutils

Basic string utilities for Solidity
Apache License 2.0
1.13k stars 372 forks source link

Add explicit conversions from bytes32 to uint256 to allow binary operations #31

Open ekpyron opened 6 years ago

ekpyron commented 6 years ago

In solidity 0.5.0 (see https://github.com/ethereum/solidity/pull/4696) we will restrict implicit (and explicit) conversions between number literals and bytesXX types. Among others this will prevent binary operations between bytesXX and hex literals that have a different size (i.e. number of digits) - explicit casts become necessary. This PR adds the necessary explicit conversions to strings.sol.