{"action":"created","issue":{"url":"https://api.github.com/repos/seishun/node-steam/issues/142","labels_url":"https://api.github.com/repos/seishun/node-steam/issues/142/labels{/name}","comments_url":"https://api.github.com/repos/seishun/node-steam/issues/142/comments","events_url":"https://api.github.com/repos/seishun/node-steam/issues/142/events","html_url":"https://github.com/seishun/node-steam/issues/142","id":69239361,"number":142,"title":"avatarHash as String","user":{"login":"riordanp","id":2303243,"avatar_url":"https://avatars.githubusercontent.com/u/2303243?v=3","gravatar_id":"","url":"https://api.github.com/users/riordanp","html_url":"https://github.com/riordanp","followers_url":"https://api.github.com/users/riordanp/followers","following_url":"https://api.github.com/users/riordanp/following{/other_user}","gists_url":"https://api.github.com/users/riordanp/gists{/gist_id}","starred_url":"https://api.github.com/users/riordanp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/riordanp/subscriptions","organizations_url":"https://api.github.com/users/riordanp/orgs","repos_url":"https://api.github.com/users/riordanp/repos","events_url":"https://api.github.com/users/riordanp/events{/privacy}","received_events_url":"https://api.github.com/users/riordanp/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-17T23:33:31Z","updated_at":"2015-11-04T13:26:17Z","closed_at":"2015-04-20T17:27:35Z","body":"I have the avatarHash field of a user as a Buffer object but would like to use it as a string. I have tried to use the toString method of the buffer (https://nodejs.org/api/buffer.html) but do not get the expected 20 character SHA-1 hash from either the ascii or utf8 encoding options. What is the correct way to convert this value to a string?\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/seishun/node-steam/issues/comments/153718786","html_url":"https://github.com/seishun/node-steam/issues/142#issuecomment-153718786","issue_url":"https://api.github.com/repos/seishun/node-steam/issues/142","id":153718786,"user":{"login":"riordanp","id":2303243,"avatar_url":"https://avatars.githubusercontent.com/u/2303243?v=3","gravatar_id":"","url":"https://api.github.com/users/riordanp","html_url":"https://github.com/riordanp","followers_url":"https://api.github.com/users/riordanp/followers","following_url":"https://api.github.com/users/riordanp/following{/other_user}","gists_url":"https://api.github.com/users/riordanp/gists{/gist_id}","starred_url":"https://api.github.com/users/riordanp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/riordanp/subscriptions","organizations_url":"https://api.github.com/users/riordanp/orgs","repos_url":"https://api.github.com/users/riordanp/repos","events_url":"https://api.github.com/users/riordanp/events{/privacy}","received_events_url":"https://api.github.com/users/riordanp/received_events","type":"User","site_admin":false},"created_at":"2015-11-04T13:26:17Z","updated_at":"2015-11-04T13:26:17Z","body":"You can use `var hash = friend.avatarHash.toString('hex');` one your friend object to get a string representation of the hash and then build a url like so:\r\n````\r\nfunction getAvatarURL(hash) {\r\n    var tag = hash.substr(0, 2);\r\n    var url = \"http://cdn.akamai.steamstatic.com/steamcommunity/public/images/avatars/\" + tag + \"/\" + hash + \"_full.jpg\";\r\n    if(hash == \"0000000000000000000000000000000000000000\"){\r\n      return \"http://cdn.akamai.steamstatic.com/steamcommunity/public/images/avatars/fe/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb_full.jpg\"\r\n    } else {\r\n      return url;\r\n    }\r\n}\r\n````\r\n\r\nThis will give the URL of the full size avatar or the default avatar if the user hasn't set one."}}