diff options
author | chriseth <chris@ethereum.org> | 2017-08-07 22:38:48 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2017-08-14 18:44:25 +0800 |
commit | bda410bb071e0d66f393aed3ee9f96d68a8fbb41 (patch) | |
tree | b27b299dff28385296ff795961c8aa5029dee2cd /libdevcore/CommonData.h | |
parent | 77b26552b1ced81a1fda72148518e59292fdff52 (diff) | |
download | dexon-solidity-bda410bb071e0d66f393aed3ee9f96d68a8fbb41.tar dexon-solidity-bda410bb071e0d66f393aed3ee9f96d68a8fbb41.tar.gz dexon-solidity-bda410bb071e0d66f393aed3ee9f96d68a8fbb41.tar.bz2 dexon-solidity-bda410bb071e0d66f393aed3ee9f96d68a8fbb41.tar.lz dexon-solidity-bda410bb071e0d66f393aed3ee9f96d68a8fbb41.tar.xz dexon-solidity-bda410bb071e0d66f393aed3ee9f96d68a8fbb41.tar.zst dexon-solidity-bda410bb071e0d66f393aed3ee9f96d68a8fbb41.zip |
Helpers.
Diffstat (limited to 'libdevcore/CommonData.h')
-rw-r--r-- | libdevcore/CommonData.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libdevcore/CommonData.h b/libdevcore/CommonData.h index ab4bfe68..6f40d7be 100644 --- a/libdevcore/CommonData.h +++ b/libdevcore/CommonData.h @@ -145,6 +145,13 @@ inline std::string toHex(u256 val, HexPrefix prefix = HexPrefix::DontAdd) return (prefix == HexPrefix::Add) ? "0x" + str : str; } +inline std::string toCompactHexWithPrefix(u256 val) +{ + std::ostringstream ret; + ret << std::hex << val; + return "0x" + ret.str(); +} + // Algorithms for string and string-like collections. /// Escapes a string into the C-string representation. |