Formatting Utilities

Functions

Others

bvggrabber.utils.format.int2bin(i, length=8)[source]

Returns the bit representation of the given integer with a minimum length of length. E.g. int2bin(109, 7) == '1101101' and int2bin(109, 8) == '01101101'.

Parameters:
  • i (int) – The integer to format
  • length (int) – The minimum length of the output string. The string is zero-padded on the left.
Returns:

The bit representation of the given int

Return type:

string

Table Of Contents

Previous topic

Utils

Next topic

API

This Page