← Files AgentBrokoARCHIVED FILE

.venv/Lib/site-packages/eth_abi/utils/padding.py

533 Bytes · Oct 3, 2026 · 06:34 UTC

↓ Download file

from eth_utils.toolz import (
    curry,
)


# typing ignored because toolz do not provide typing info
@curry  # type: ignore
def zpad(value: bytes, length: int) -> bytes:
    return value.rjust(length, b"\x00")


zpad32 = zpad(length=32)


@curry  # type: ignore
def zpad_right(value: bytes, length: int) -> bytes:
    return value.ljust(length, b"\x00")


zpad32_right = zpad_right(length=32)


@curry  # type: ignore
def fpad(value: bytes, length: int) -> bytes:
    return value.rjust(length, b"\xff")


fpad32 = fpad(length=32)

SHA-256: 0f23b34219e999f7ff58a5f12b1886e931caf22d7edd709edc8c8019a13b6d14