add
This commit is contained in:
27
ccxt/static_dependencies/ethereum/abi/utils/padding.py
Normal file
27
ccxt/static_dependencies/ethereum/abi/utils/padding.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from ...utils.toolz import (
|
||||
curry,
|
||||
)
|
||||
|
||||
|
||||
@curry
|
||||
def zpad(value: bytes, length: int) -> bytes:
|
||||
return value.rjust(length, b"\x00")
|
||||
|
||||
|
||||
zpad32 = zpad(length=32)
|
||||
|
||||
|
||||
@curry
|
||||
def zpad_right(value: bytes, length: int) -> bytes:
|
||||
return value.ljust(length, b"\x00")
|
||||
|
||||
|
||||
zpad32_right = zpad_right(length=32)
|
||||
|
||||
|
||||
@curry
|
||||
def fpad(value: bytes, length: int) -> bytes:
|
||||
return value.rjust(length, b"\xff")
|
||||
|
||||
|
||||
fpad32 = fpad(length=32)
|
||||
Reference in New Issue
Block a user