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

Converts an integer to its byte representation.

Behavior

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

Parameters

  • num: The integer to be converted into bytes.

Returns

  • Return value 1: The byte representation of the integer with leading null bytes removed.