aboutsummaryrefslogtreecommitdiffstats
path: root/libdevcore
diff options
context:
space:
mode:
Diffstat (limited to 'libdevcore')
-rw-r--r--libdevcore/Common.h11
-rw-r--r--libdevcore/UTF8.h2
2 files changed, 12 insertions, 1 deletions
diff --git a/libdevcore/Common.h b/libdevcore/Common.h
index d65cfeac..225f38ac 100644
--- a/libdevcore/Common.h
+++ b/libdevcore/Common.h
@@ -135,6 +135,17 @@ inline u256 s2u(s256 _u)
return u256(c_end + _u);
}
+inline std::ostream& operator<<(std::ostream& os, bytes const& _bytes)
+{
+ std::ostringstream ss;
+ ss << std::hex;
+ std::copy(_bytes.begin(), _bytes.end(), std::ostream_iterator<int>(ss, ","));
+ std::string result = ss.str();
+ result.pop_back();
+ os << "[" + result + "]";
+ return os;
+}
+
template <size_t n> inline u256 exp10()
{
return exp10<n - 1>() * u256(10);
diff --git a/libdevcore/UTF8.h b/libdevcore/UTF8.h
index 3e39273c..9bdc2b4f 100644
--- a/libdevcore/UTF8.h
+++ b/libdevcore/UTF8.h
@@ -29,7 +29,7 @@ namespace dev
{
/// Validate an input for UTF8 encoding
-/// @returns true if it is invalid and the first invalid position in invalidPosition
+/// @returns false if it is invalid and the first invalid position in invalidPosition
bool validate(std::string const& _input, size_t& _invalidPosition);
}