h = hashlib.new('sha1')
buf = array.array('L', [320])
while True:
    sm.readinto(buf)
    h.update(buf)
    d = h.digest()
    usb_cdc.data.write(d)