def METHOD_NAME(length: int) -> bytes:
    """
    Pack structure length as expected in BER specification
    :param length: structure length.
    """
    if length > 0x7f:
        return Uint8.pack(0x82) + Uint16BE.pack(length)
    else:
        return Uint8.pack(length)