src/fnpb/ln/invoice.py
def clip_memo(memo: str) -> str:
    """Clips the memo such that it is within the MEMO_MAX_BYTES size.

    Args:
        memo: The memo to clip.
    Returns:
        The clipped memo such that its size is less than the MEMO_MAX_BYTES.
    """
    if len(memo.encode("utf-8")) > MEMO_MAX_BYTES:
        _memo = ""
        for i, c in enumerate(memo):
            if len((_memo + c).encode("utf-8")) < MEMO_MAX_BYTES:
                _memo += c
        return _memo
    return memo
Clips the memo such that it is within the MEMO_MAX_BYTES size.

    Args:
        memo: The memo to clip.
    Returns:
        The clipped memo such that its size is less than the MEMO_MAX_BYTES.
    
Clips the memo such that it is within the MEMO_MAX_BYTES size.
Clips the memo such that it is within the MEMO_MAX_BYTES size .
def clip_memo(memo: str) -> str:
    if len(memo.encode("utf-8")) > MEMO_MAX_BYTES:
        _memo = ""
        for i, c in enumerate(memo):
            if len((_memo + c).encode("utf-8")) < MEMO_MAX_BYTES:
                _memo += c
        return _memo
    return memo
def clip_memo ( memo : str ) -> str : if len ( memo . encode ( "utf-8" ) ) > MEMO_MAX_BYTES : _memo = "" for i , c in enumerate ( memo ) : if len ( ( _memo + c ) . encode ( "utf-8" ) ) < MEMO_MAX_BYTES : _memo += c return _memo return memo
Clips the memo such that it is within the MEMO_MAX_BYTES size.
Clips the memo such that it is within the MEMO_MAX_BYTES size .
"""Clips the memo such that it is within the MEMO_MAX_BYTES size.

    Args:
        memo: The memo to clip.
    Returns:
        The clipped memo such that its size is less than the MEMO_MAX_BYTES.
    """
The clipped memo such that its size is less than the MEMO_MAX_BYTES.
The clipped memo such that its size is less than the MEMO_MAX_BYTES .
memo
str
The memo to clip.
The memo to clip .