Commit b28723fc authored by Derek Schaab's avatar Derek Schaab

Add package-level documentation comment

parent ef7d0f24
Package ident provides functions for rendering 8x8 identicons from 32-bit
integers in both vector and raster formats.
To use this package, first convert the data to be represented as an identicon
to a uint32. For example, if you have an IPv4 address:
ip := net.ParseIP("") // there's no place like it
i := ident.Icon((ip[12] << 24) | (ip[13] << 16) | (ip[14] << 8) | ip[15])
Or if you have arbitrary byte data, consider a checksum:
data := []byte("The quick red fox jumps over the lazy brown dog.")
i := ident.Icon(crc32.ChecksumIEEE(data))
You can now render i to any io.Writer. For example, to send an SVG to standard
err := i.WriteSVG(os.Stdout, 256)
This package renders 8x8 identicons with horizontal symmetry. As such, if the
given size is not evenly divisible by eight, it is rounded down until it is.
An identicon can be no smaller than eight pixels.
The algorithm employed by this library uses three bytes of the input to
determine the block layout and the remaining byte to determine the color. Put
another way, each block pattern appears 256 times with a slightly different
package ident
import (
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment