MCPcopy Create free account
hub / github.com/argotorg/solidity / numberEncodingSize

Function numberEncodingSize

libsolutil/Numeric.h:173–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171/// Determine bytes required to encode the given integer value. @returns 0 if @a _i is zero.
172template <class T>
173inline 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}

Callers 10

codeSizeMethod · 0.85
setBigEndianFunction · 0.85
assemblePushMethod · 0.85
Assembly.cppFile · 0.85
bytesRequiredMethod · 0.85
findRepresentationMethod · 0.85
integerTypeMethod · 0.85
fixedPointTypeMethod · 0.85
pushMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected