duniterpy package

Subpackages

Submodules

duniterpy.constants module

duniterpy.tools module

duniterpy.tools.convert_seed_to_seedhex(seed: bytes) str

Convert seed to seedhex

Parameters:

seed – seed

Rtype str:

duniterpy.tools.convert_seedhex_to_seed(seedhex: str) bytes

Convert seedhex to seed

Parameters:

seedhex – seed coded in hexadecimal base

Rtype bytes:

duniterpy.tools.ensure_bytes(data: str | bytes) bytes

Convert data in bytes if data is a string

Parameters:

data – Data

Rtype bytes:

duniterpy.tools.ensure_str(data: str | bytes) str

Convert data in str if data are bytes

Parameters:

data – Data

Rtype str:

duniterpy.tools.get_ws2p_challenge() str

Return two uuid v4 concatened as ws2p challenge

Rtype str:

duniterpy.tools.xor_bytes(b1: bytes, b2: bytes) bytearray

Apply XOR operation on two bytes arguments

Parameters:
  • b1 – First bytes argument

  • b2 – Second bytes argument

Rtype bytearray:

Module contents