Remove w parameter for toHex.

This commit is contained in:
chriseth
2018-12-05 22:51:49 +01:00
parent e8455c2a6d
commit bc6ddbdd09
8 changed files with 15 additions and 16 deletions
+3 -3
View File
@@ -61,7 +61,7 @@ enum class HexCase
/// Convert a series of bytes to the corresponding string of hex duplets.
/// @param _w specifies the width of the first of the elements. Defaults to two - enough to represent a byte.
/// @example toHex("A\x69") == "4169"
std::string toHex(bytes const& _data, int _w = 2, HexPrefix _prefix = HexPrefix::DontAdd, HexCase _case = HexCase::Lower);
std::string toHex(bytes const& _data, HexPrefix _prefix = HexPrefix::DontAdd, HexCase _case = HexCase::Lower);
/// Converts a (printable) ASCII hex character into the correspnding integer value.
/// @example fromHex('A') == 10 && fromHex('f') == 15 && fromHex('5') == 5
@@ -153,7 +153,7 @@ inline std::string formatNumber(bigint const& _value)
if (_value < 0)
return "-" + formatNumber(-_value);
if (_value > 0x1000000)
return toHex(toCompactBigEndian(_value), 2, HexPrefix::Add);
return toHex(toCompactBigEndian(_value), HexPrefix::Add);
else
return _value.str();
}
@@ -161,7 +161,7 @@ inline std::string formatNumber(bigint const& _value)
inline std::string formatNumber(u256 const& _value)
{
if (_value > 0x1000000)
return toHex(toCompactBigEndian(_value), 2, HexPrefix::Add);
return toHex(toCompactBigEndian(_value), HexPrefix::Add);
else
return _value.str();
}