Skip to content

Instantly share code, notes, and snippets.

@pgilad pgilad/main.go
Created Aug 8, 2018

What would you like to do?
Generate stable random name from string (used to generate docker tag from git branch)
package main
import (
func hash(s string) uint64 {
alg := fnv.New64a()
return alg.Sum64()
func main() {
branch := os.Args[1]
seed := int64(hash(branch))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.