Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/naknomum/hexicon
Like identicons, but a hexagon, and svg.
https://github.com/naknomum/hexicon
Last synced: 3 months ago
JSON representation
Like identicons, but a hexagon, and svg.
- Host: GitHub
- URL: https://github.com/naknomum/hexicon
- Owner: naknomum
- Created: 2018-01-21T10:33:28.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2021-11-27T06:52:34.000Z (about 3 years ago)
- Last Synced: 2024-06-11T16:28:57.558Z (8 months ago)
- Language: JavaScript
- Size: 61.5 KB
- Stars: 15
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-identicons - Hexicon
README
# hexicon
A *hexicon* is like an [identicon](https://en.wikipedia.org/wiki/Identicon), but in the form of a hexagon.
![hexicon.js](hexicon.js.png "hexicon.js")
This javascript library creates the hexicon using an svg. The hashing function used is [sdbm](http://www.cse.yorku.ca/~oz/hash.html), which is what I found used in some identicon libraries. The patterning and color algorithms are my own invention. See: [details on how the drawing is made](explain.md).
## Example
Try out some [dynamical examples](https://naknomum.github.io/hexicon-example/) of **hexicons** in action.
## Usage
```javascript
var el = document.getElementById('svg-element');
var hex = new Hexicon(el, "some text");
hex.updateText("something different");var hash = hex.getHash();
hex.updateHash('3ddd0999');
hex.updateHash(1037896089);
```## Similar projects
Another identicon project of mine, [Solacon.svg](https://github.com/naknomum/solacon).
For related work, check out [Awesome Identicons](https://github.com/drhus/awesome-identicons), a curated list of _visual hashes_ maintained by **Husam ABBOUD**.