**Use case**

Viewing binary data such as bitmasks, hashes, internal representation of IEEE-754 numbers, etc.
Mostly for debugging.

**Describe the solution you'd like**

Similar to `hex`/`unhex`.

`bin` - returns a string with `0` and `1`. Bits are in "human" order, most significant first. Most significant zero bits are not printed (except the case with single zero).

**Describe alternatives you've considered**

Now I have to run interactive `python` from command line, but I will be more happy using ClickHouse.

**Caveats**

The name `bin` may suggest that the function will "split data into bins" but it is completely unrelated.
#pragma once
#include <string>
extern const char * const hex_digit_to_char_uppercase_table;
extern const char * const hex_digit_to_char_lowercase_table;
inline char hexDigitUppercase(unsigned char c)
{
    return hex_digit_to_char_uppercase_table[c];
}
inline char hexDigitLowercase(unsigned char c)
{
    return hex_digit_to_char_lowercase_table[c];
}
#include <cstring>
#include <cstddef>
#include <common/types.h>
extern const char * const hex_byte_to_char_uppercase_table;
extern const char * const hex_byte_to_char_lowercase_table;
inline void writeHexByteUppercase(UInt8 byte, void * out)
{
    memcpy(out, &hex_byte_to_char_uppercase_table[static_cast<size_t>(byte) * 2], 2);
}
inline void writeHexByteLowercase(UInt8 byte, void * out)
{
    memcpy(out, &hex_byte_to_char_lowercase_table[static_cast<size_t>(byte) * 2], 2);
}
template <typename TUInt>
inline void writeHexUIntImpl(TUInt uint_, char * out, const char * const table)