| 171 | /// Determine bytes required to encode the given integer value. @returns 0 if @a _i is zero. |
| 172 | template <class T> |
| 173 | inline unsigned numberEncodingSize(T _i) |
| 174 | { |
| 175 | static_assert(std::is_same<bigint, T>::value || !std::numeric_limits<T>::is_signed, "only unsigned types or bigint supported"); //bigint does not carry sign bit on shift |
| 176 | unsigned i = 0; |
| 177 | for (; _i != 0; ++i, _i >>= 8) {} |
| 178 | return i; |
| 179 | } |
| 180 | |
| 181 | } |
no outgoing calls
no test coverage detected