code: func NewGenerator(filename string) *Generator {
  	ret := &Generator{
  		imports: map[string]string{
  			pkgWriter:       "jwriter",
  			pkgLexer:        "jlexer",
  			pkgEasyJSON:     "easyjson",
  			"encoding/json": "json",
  		},
  		fieldNamer:    DefaultFieldNamer{},
  		marshalers:    make(map[reflect.Type]bool),
  		typesSeen:     make(map[reflect.Type]bool),
  		functionNames: make(map[string]reflect.Type),
  	}
  
  	// Use a file-unique prefix on all auxiliary funcs to avoid
  	// name clashes.
  	hash := fnv.New32()
  	hash.Write([]byte(filename))
  	ret.hashString = fmt.Sprintf("%x", hash.Sum32())
  
  	return ret
  }
docs: // NewGenerator initializes and returns a Generator.