3

I want to get official GitHub implementation of identicon algorithm. Where can i found that thank you.

I've found a lot of tutorials but they all are not official implementation, How can i do this?

dan1st
  • 12,568
  • 8
  • 34
  • 67

1 Answers1

1

As stated in an answer of this Twitter Post, there is no official release but an employee of GitHub ported it to rust and published it here. The number from that you need to enter there is the id of your user. You can get it by running a request to https://api.github.com/users/<username> (the field is named id).

After building it, you can test it using the following command (bash, $ghUserId):

echo -n "$ghUserId" | ./target/debug/identicon > identicon.png

In order to get the user id from the username and calculate the identicon in one command, you can use this (if you have installed jq, $githubUserName is a variable with the user name):

curl "https://api.github.com/users/$githubUserName" | jq .id | ./target/debug/identicon > identicon.png

Also note that I used ./target/debug/identicon as the executable as I found it here after building it.

You can also get the identicon from https://github.com/identicons/<username>.png as stated in this blog post.

dan1st
  • 12,568
  • 8
  • 34
  • 67
  • wow thank you @dan1st . I am also making project on it. Thank you :). but i am afraid those stackoverflow havent also opensourced their identicon generation algorithm . But anyway :) –  Dec 03 '20 at 10:00
  • 1
    Nice to hear that but I think that a port from an official employee works good, too. – dan1st Dec 03 '20 at 10:05