displayname: github.com/thomasf/displayname Index | Files

package displayname

import "github.com/thomasf/displayname"


Package Files

displayname.go words.go

func FromString Uses

func FromString(s string) string

FromString returns a display name based on a crc32 hash and interal wordlist. Returned names are composed of 4 words.

type Generator Uses

type Generator struct {
    Words []string
    // contains filtered or unexported fields

Generator generates human readable display names from data by combining a hash function and a word list.

The return value is the Hash sum in the base of the length of the Words slice with all words. This package is NOT meant to provide any kind of security, crc32 is used in the default implementation since it produces a 4 word string with a small word list.

func (Generator) FromString Uses

func (g Generator) FromString(s string) (string, error)

FromString returns the display name of the input string.

func (Generator) String Uses

func (g Generator) String() string

String returns the code name for the current hash value being held.

Package displayname imports 4 packages (graph) and is imported by 1 packages. Updated 2016-08-20. Refresh now. Tools for package owners.