Press CTRL+C or CMD+C to copy the selected text and close this dialog.
Tweet
5 people like it. Like the snippet!
simple CRC16
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11:
let Crc16 msg = let polynomial = 0xA001us let mutable code = 0xffffus for b in msg do code <- code ^^^ uint16 b for j in [0..7] do if (code &&& 1us <> 0us) then code <- (code >>> 1) ^^^ polynomial else code <- code >>> 1 code