import struct


def ub16(b):
    """Convert bytes (LSB first) to a 16-bit integer.

    Example:
            ub16(b'\x12\x34') == 0x3412
    """
    (value, ) = struct.unpack('<H', b)
    return value