{"id":29711687,"url":"https://github.com/zinggi/elm-hash-icon","last_synced_at":"2025-10-10T01:11:51.911Z","repository":{"id":57674735,"uuid":"123424669","full_name":"Zinggi/elm-hash-icon","owner":"Zinggi","description":"A library for creating consistent, good looking, random icons","archived":false,"fork":false,"pushed_at":"2018-03-02T10:40:59.000Z","size":271,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-24T00:24:53.285Z","etag":null,"topics":["elm","hash-functions","icons","svg","svg-icons"],"latest_commit_sha":null,"homepage":"http://package.elm-lang.org/packages/Zinggi/elm-hash-icon/latest","language":"Elm","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Zinggi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-01T11:14:38.000Z","updated_at":"2021-02-10T23:42:25.000Z","dependencies_parsed_at":"2022-09-02T17:08:58.072Z","dependency_job_id":null,"html_url":"https://github.com/Zinggi/elm-hash-icon","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/Zinggi/elm-hash-icon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zinggi%2Felm-hash-icon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zinggi%2Felm-hash-icon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zinggi%2Felm-hash-icon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zinggi%2Felm-hash-icon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zinggi","download_url":"https://codeload.github.com/Zinggi/elm-hash-icon/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zinggi%2Felm-hash-icon/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002405,"owners_count":26083373,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elm","hash-functions","icons","svg","svg-icons"],"created_at":"2025-07-23T23:09:35.465Z","updated_at":"2025-10-10T01:11:51.906Z","avatar_url":"https://github.com/Zinggi.png","language":"Elm","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hash Icons\n\n![](https://github.com/Zinggi/elm-hash-icon/raw/master/examples/imgs/hashOfElm.svg?sanitize=true)\n\n**[Demo](https://zinggi.github.io/randomDemos/other/elmHashIcon.html)** / [Source](https://github.com/Zinggi/elm-hash-icon/blob/master/examples/Main.elm)\n\nThis implements a sort of **visual hash** function.  \nE.g, the icons above were generated using `iconsFromString 120 3.0 5 \"Elm\"`.  \nThe idea is to create a unique icon for every possible input.  \nThis can for instance be used as an avatar for anonymous users in a forum.  \nIt might also be used to quickly confirm if two files are different.  \n\n\n\n## Features\n\nFrom a visual hash function, we want a few different features:\n  \n  * Every possible value should be **easy to remember**\n  * **No** two values should be too easy to **confuse**\n  * Every icon should look 'good' or at least **not ugly**\n  * There should be a high number of possible icons, such that **collisions** are **rare**\n  * These properties should also hold for **colorblind** people\n\nThese goals are conflicting, but I think this library (and the idea in general) provides a nice trade-off.\n\n\n## Collision resistance\n\nCompared to other well known hash functions like SHA-256 (256 bit) or MD5 (128 bits),\nthis visual hash function has a much much worse collision resistance.\nThe hash icon provides roughly **20 bits** of entropy, so it shouldn't be used for anything critical.\n\nThe trade-off between collision resistance and good looking icons is adjustable with a cut-off ratio.\nColor combinations with a contrast ratio below the cut-off ratio are discarded.\n\nTo increase the collision resistance, you might want to use multiple icons in a row.\n~~E.g. with a ratio of 3.4 a row of 7 icons provides as many bytes as MD5.\nOr with a ratio of 8.4 we would need 8 icons, but it would look much nicer.~~\n\n**Warning:** The above is not correct!  \nThe way I generate multiple icons from one string does not provide the expected collision resistance.  \nTurns out it's much more complicated, read [this paper](http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.99.9368).  \n**TODO**: switch to a better hash function such that the above becomes true.\n(At least for a reasonably small (1-20) number of icons).\n\n\n## Customize\nWant to use another set of colors? Another set of icons?  \n**Create a fork!**  \n\nI didn't make these things adjustable, because I thought most people don't want to make any adjustments.  \nAlso, having a few forks around that take the same idea but with different trade-offs sounds exciting to me.  \n\nIf you do end up forking this library, please **let me know** so that I can provide a link here.  \n\n## Bugs\nSome icons are chopped off.\nThe problem has already been noted [here](https://github.com/jystic/elm-font-awesome/issues/1) and is hopefully fixed soon.\n\n## Update Log\n**Note**: I will bump the major version every time there are some visual changes.\nEven if it would technically not be a major change,\nit would break the implicit contract that the same string always hashes to the same icon.\n\n  * 2.0.0 -\u003e Removed brands by default, but they can be enabled if desired.\n  * 1.0.0 -\u003e First version\n\n## Prior art\n\n  * Probably the [original \"identicon\"](https://web.archive.org/web/20080703155519/http://www.docuverse.com/blog/donpark/2007/01/18/visual-security-9-block-ip-identification)\n  * Github's version, e.g. as implemented [here](https://github.com/pukkamustard/elm-identicon)\n\n## Credits\nIcons from [Font Awesome](https://fontawesome.com/)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzinggi%2Felm-hash-icon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzinggi%2Felm-hash-icon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzinggi%2Felm-hash-icon/lists"}