public static int CountHexDigits(UInt128 value) { // The number of hex digits is log16(value) + 1, or log2(value) / 4 + 1 return(((int)UInt128.Log2(value) >> 2) + 1); }