Skip to main content

int_to_bytes

Python API reference for the function encoding.int_to_bytes.

Public API

Function: int_to_bytes

Canonical path: encoding.int_to_bytes

Declared in: encoding.py

Signature

def int_to_bytes(num): ...

Summary

Convert an integer to a byte string.

Behavior

The function converts an integer to bytes and removes leading null bytes.

Parameters

  • num: The integer to be converted.

Returns

  • Return value 1: The resulting byte string without leading null bytes.