func NewSalter(sources RandomSourceList, input []byte) *Salter {
	if input == nil {
		input = []byte("")
	}

	hash := sha256.New()
	hash.Write(input)

	sum := 0
	for _, v := range sources {
		sum += v.Weight
	}

	return &Salter{
		salt:       hash.Sum(nil),
		rndSources: sources,
		sumWeight:  sum,
	}
}
func NewSalter(sources RandomSourceList, input []byte) *Salter {
	if input == nil {
		input = []byte("")
	}

	hash := sha256.New()
	hash.Write(input)

	sum := 0
	for _, v := range sources {
		sum += v.Weight
	}

	return &Salter{
		salt:       hash.Sum(nil),
		rndSources: sources,
		sumWeight:  sum,
	}
}
func NewSalter ( sources RandomSourceList , input [ ] byte ) * Salter { if input == nil { input = [ ] byte ( " " ) } hash := sha256 . New ( ) hash . Write ( input ) sum := 0 for _ , v := range sources { sum += v . Weight } return & Salter { salt : hash . Sum ( nil ) , rndSources : sources , sumWeight : sum , } }
// NewSalter creates a new instance of Salter. It requires a list of sources of
// random data and optionally an input to salt next token.
NewSalter creates a new instance of Salter . It requires a list of sources of random data and optionally an input to salt next token .