25 lines
476 B
Go
25 lines
476 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/kevin/go-jdenticon/jdenticon"
|
|
)
|
|
|
|
func main() {
|
|
testInputs := []string{"test-hash", "example1@gmail.com"}
|
|
|
|
for _, input := range testInputs {
|
|
hash := jdenticon.ToHash(input)
|
|
fmt.Printf("Input: \"%s\"\n", input)
|
|
fmt.Printf("Go SHA1: %s\n", hash)
|
|
|
|
svg, err := jdenticon.ToSVG(input, 64)
|
|
if err != nil {
|
|
fmt.Printf("Error: %v\n", err)
|
|
} else {
|
|
fmt.Printf("SVG length: %d\n", len(svg))
|
|
}
|
|
fmt.Println("---")
|
|
}
|
|
} |