payload: {"action":"created","issue":{"url":"https://api.github.com/repos/howeyc/crc16/issues/7","repository_url":"https://api.github.com/repos/howeyc/crc16","labels_url":"https://api.github.com/repos/howeyc/crc16/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/howeyc/crc16/issues/7/comments","events_url":"https://api.github.com/repos/howeyc/crc16/issues/7/events","html_url":"https://github.com/howeyc/crc16/issues/7","id":388211108,"node_id":"MDU6SXNzdWUzODgyMTExMDg=","number":7,"title":"crc16 modbus giving wrong result","user":{"login":"johnwick03","id":45661160,"node_id":"MDQ6VXNlcjQ1NjYxMTYw","avatar_url":"https://avatars3.githubusercontent.com/u/45661160?v=4","gravatar_id":"","url":"https://api.github.com/users/johnwick03","html_url":"https://github.com/johnwick03","followers_url":"https://api.github.com/users/johnwick03/followers","following_url":"https://api.github.com/users/johnwick03/following{/other_user}","gists_url":"https://api.github.com/users/johnwick03/gists{/gist_id}","starred_url":"https://api.github.com/users/johnwick03/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnwick03/subscriptions","organizations_url":"https://api.github.com/users/johnwick03/orgs","repos_url":"https://api.github.com/users/johnwick03/repos","events_url":"https://api.github.com/users/johnwick03/events{/privacy}","received_events_url":"https://api.github.com/users/johnwick03/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-06T13:21:15Z","updated_at":"2019-03-11T18:42:26Z","closed_at":null,"author_association":"NONE","body":"I tried getting crc for hex string 08000001 using crc16.ChecksumIBM. But instead of 84C3 it is giving me 3226. This is my code:\r\n`\tdata := []byte(\"08000001\")`\r\n\t`checksum := crc16.ChecksumIBM(data)`\r\n\t`fmt.Println(\"\\n checksum:\", checksum)`"},"comment":{"url":"https://api.github.com/repos/howeyc/crc16/issues/comments/471669620","html_url":"https://github.com/howeyc/crc16/issues/7#issuecomment-471669620","issue_url":"https://api.github.com/repos/howeyc/crc16/issues/7","id":471669620,"node_id":"MDEyOklzc3VlQ29tbWVudDQ3MTY2OTYyMA==","user":{"login":"aliakseiz","id":5099395,"node_id":"MDQ6VXNlcjUwOTkzOTU=","avatar_url":"https://avatars0.githubusercontent.com/u/5099395?v=4","gravatar_id":"","url":"https://api.github.com/users/aliakseiz","html_url":"https://github.com/aliakseiz","followers_url":"https://api.github.com/users/aliakseiz/followers","following_url":"https://api.github.com/users/aliakseiz/following{/other_user}","gists_url":"https://api.github.com/users/aliakseiz/gists{/gist_id}","starred_url":"https://api.github.com/users/aliakseiz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aliakseiz/subscriptions","organizations_url":"https://api.github.com/users/aliakseiz/orgs","repos_url":"https://api.github.com/users/aliakseiz/repos","events_url":"https://api.github.com/users/aliakseiz/events{/privacy}","received_events_url":"https://api.github.com/users/aliakseiz/received_events","type":"User","site_admin":false},"created_at":"2019-03-11T18:42:26Z","updated_at":"2019-03-11T18:42:26Z","author_association":"NONE","body":"Replace with `checksum := ^crc16.ChecksumIBM(data)`\r\nModbus checksum should be calculated without XOR out. Take a look at Modbus test in this repository.\r\n\r\nBut still you will not get `0x84C3`, because you're building CRC of ASCII chars array.\r\n\r\n`\td := []byte(\"08000001\")\r\n\tc := ^crc16.ChecksumIBM(d)\r\n\tfmt.Printf(\"checksum:%X\\n\", c) // checksum:F365\r\n\r\n\td = []byte{0x08, 0x00, 0x00, 0x01}\r\n\tc = ^crc16.ChecksumIBM(d)\r\n\tfmt.Printf(\"checksum:%X\\n\", c) // checksum:84C3\r\n\r\n\ts := \"08000001\"\r\n\td, err = hex.DecodeString(s)\r\n\tc = ^crc16.ChecksumIBM(d)\r\n\tfmt.Printf(\"checksum:%X\\n\", c) // checksum:84C3\r\n`\r\n\r\n"}}
other: {"actor":{"display_login":"aliakseiz"}}