{"action":"created","issue":{"url":"https://api.github.com/repos/TokTok/c-toxcore/issues/205","repository_url":"https://api.github.com/repos/TokTok/c-toxcore","labels_url":"https://api.github.com/repos/TokTok/c-toxcore/issues/205/labels{/name}","comments_url":"https://api.github.com/repos/TokTok/c-toxcore/issues/205/comments","events_url":"https://api.github.com/repos/TokTok/c-toxcore/issues/205/events","html_url":"https://github.com/TokTok/c-toxcore/issues/205","id":184940444,"number":205,"title":"nospam value is reversed in array returned by tox_self_get_address()","user":{"login":"pranomostro","id":14915570,"avatar_url":"https://avatars.githubusercontent.com/u/14915570?v=3","gravatar_id":"","url":"https://api.github.com/users/pranomostro","html_url":"https://github.com/pranomostro","followers_url":"https://api.github.com/users/pranomostro/followers","following_url":"https://api.github.com/users/pranomostro/following{/other_user}","gists_url":"https://api.github.com/users/pranomostro/gists{/gist_id}","starred_url":"https://api.github.com/users/pranomostro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pranomostro/subscriptions","organizations_url":"https://api.github.com/users/pranomostro/orgs","repos_url":"https://api.github.com/users/pranomostro/repos","events_url":"https://api.github.com/users/pranomostro/events{/privacy}","received_events_url":"https://api.github.com/users/pranomostro/received_events","type":"User","site_admin":false},"labels":[{"id":403702216,"url":"https://api.github.com/repos/TokTok/c-toxcore/labels/CAT:bug","name":"CAT:bug","color":"ee0701","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-10-24T20:04:07Z","updated_at":"2016-10-27T20:03:10Z","closed_at":null,"body":"I have written following example code:\r\n\r\n    #include <stdio.h>\r\n    #include <stdlib.h>\r\n    \r\n    #include <tox/tox.h>\r\n    \r\n    int main(void)\r\n    {\r\n    \tsize_t i;\r\n    \tuint8_t addr[TOX_ADDRESS_SIZE];\r\n    \tchar* nns=\"AABBCCDD\";\r\n    \tuint32_t ns;\r\n    \tTox* t;\r\n    \tstruct Tox_Options to;\r\n    \r\n    \ttox_options_default(&to);\r\n    \tt=tox_new(&to, NULL);\r\n    \r\n    \tns=tox_self_get_nospam(t);\r\n    \ttox_self_get_address(t, addr);\r\n    \r\n    \tprintf(\"current addr: \");\r\n    \tfor(i=0; i<TOX_ADDRESS_SIZE; i++)\r\n    \t\tprintf(\"%02X\", addr[i]);\r\n    \tputchar('\\n');\r\n    \tprintf(\"current ns: %08X\\n\", ns);\r\n    \r\n    \tns=strtoul(nns, NULL, 16);\r\n    \r\n    \ttox_self_set_nospam(t, ns);\r\n    \r\n    \tns=tox_self_get_nospam(t);\r\n    \ttox_self_get_address(t, addr);\r\n    \r\n    \tprintf(\"current addr: \");\r\n    \tfor(i=0; i<TOX_ADDRESS_SIZE; i++)\r\n    \t\tprintf(\"%02X\", addr[i]);\r\n    \tputchar('\\n');\r\n    \tprintf(\"current ns: %08X\\n\", ns);\r\n    \r\n    \treturn 0;\r\n    }\r\n\r\nWhen compiled with\r\n    gcc -o tns tns.c -ltoxcore\r\n\r\nand executed, this prints\r\n\r\n    current addr: 5A9712242692889C310A7227CD78D3D9F0F9F5AE9608DDD3640175419093A33368C3A8A5173B\r\n    current ns: A5A8C368\r\n    current addr: 5A9712242692889C310A7227CD78D3D9F0F9F5AE9608DDD3640175419093A333DDCCBBAAB13B\r\n    current ns: AABBCCDD\r\n\r\nAs you can see, the checksum (the addresses last 4 bytes-2) is reversed, instead `AABBCCDD` they are `DDCCBBAA`.\r\n\r\nI am running Arch linux, Kernel 4.8.1, gcc 6.2.1, toxcore-toktok-git 3911-1.\r\nIf this is intended behaviour, ignore this."},"comment":{"url":"https://api.github.com/repos/TokTok/c-toxcore/issues/comments/256753334","html_url":"https://github.com/TokTok/c-toxcore/issues/205#issuecomment-256753334","issue_url":"https://api.github.com/repos/TokTok/c-toxcore/issues/205","id":256753334,"user":{"login":"GrayHatter","id":243408,"avatar_url":"https://avatars.githubusercontent.com/u/243408?v=3","gravatar_id":"","url":"https://api.github.com/users/GrayHatter","html_url":"https://github.com/GrayHatter","followers_url":"https://api.github.com/users/GrayHatter/followers","following_url":"https://api.github.com/users/GrayHatter/following{/other_user}","gists_url":"https://api.github.com/users/GrayHatter/gists{/gist_id}","starred_url":"https://api.github.com/users/GrayHatter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GrayHatter/subscriptions","organizations_url":"https://api.github.com/users/GrayHatter/orgs","repos_url":"https://api.github.com/users/GrayHatter/repos","events_url":"https://api.github.com/users/GrayHatter/events{/privacy}","received_events_url":"https://api.github.com/users/GrayHatter/received_events","type":"User","site_admin":false},"created_at":"2016-10-27T20:03:10Z","updated_at":"2016-10-27T20:03:10Z","body":">  On big endian systems, friend requests probably don't work.\r\n\r\nlol... OH FUCK"}}
{"actor":{"display_login":"GrayHatter"}}