klefki.utils

Module Contents

Classes

EnumDict

dict() -> new empty dictionary

Functions

int_to_byte(key: int, length=32) → bytes

int_to_byte64(key: int) → bytes

byte_to_int(byte: bytes) → CF

to_keccak256int(a: str) → int

dhash256(x: int) → int

ripemd160(x) → int

trunks(l: Iterable, n: int) → Iterator

concat(a: bytes, b: bytes) → bytes

compose(*fs: Iterable[Callable])

to_sha256int(m: str)

parse_lv_format(b)

CF2Bytes(cf, l=32)

to_u32s(a: int, endian='little')

from_u32s(a: list, endian='little')

from_u64s(a: list, endian='little')

to_u64s(a: int, endian='little')

klefki.utils.b58encode
klefki.utils.b64encode
klefki.utils.int_to_byte(key: int, length=32) → bytes
klefki.utils.int_to_byte64(key: int) → bytes
klefki.utils.byte_to_int(byte: bytes) → CF
klefki.utils.to_keccak256int(a: str) → int
klefki.utils.dhash256(x: int) → int
klefki.utils.ripemd160(x) → int
klefki.utils.trunks(l: Iterable, n: int) → Iterator
klefki.utils.concat(a: bytes, b: bytes) → bytes
klefki.utils.compose(*fs: Iterable[Callable])
klefki.utils.to_sha256int(m: str)
class klefki.utils.EnumDict

Bases: dict

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

__getattr__(self, k)

Support Lazy

__setattr__(self, k, v)

Implement setattr(self, name, value).

__contains__(self, v)

True if the dictionary has the specified key, else False.

klefki.utils.parse_lv_format(b)
klefki.utils.CF2Bytes(cf, l=32)
klefki.utils.to_u32s(a: int, endian='little')
klefki.utils.from_u32s(a: list, endian='little')
klefki.utils.from_u64s(a: list, endian='little')
klefki.utils.to_u64s(a: int, endian='little')