identicond/vendor/github.com/jakobvarmose/go-qidenticon
Cadey Ratio 221c2ebe49 initial commit, everything works 2017-12-29 17:10:53 -05:00
..
LICENSE initial commit, everything works 2017-12-29 17:10:53 -05:00
README.md initial commit, everything works 2017-12-29 17:10:53 -05:00
qidenticon.go initial commit, everything works 2017-12-29 17:10:53 -05:00
sample.png initial commit, everything works 2017-12-29 17:10:53 -05:00

README.md

qidenticon (from Bitmessage) ported to Go

Sample icons

Sample icons

Example

package main

import (
	"image/png"
	"os"

	"github.com/jakobvarmose/go-qidenticon"
)

func main() {
	code := qidenticon.Code("test")
	size := 30
	settings := qidenticon.DefaultSettings()
	img := qidenticon.Render(code, size, settings)
	w, err := os.Create("test.png")
	if err != nil {
		panic(err)
	}
	defer w.Close()
	err = png.Encode(w, img)
	if err != nil {
		panic(err)
	}
}