public static int IdSize(ulong id) { ulong mask = (id + 1) | 1; int index = 0; while (mask > 1) { mask >>= 1; index++; } return (index-1)/7 +1; }