returnrand.New(rand.NewSource(seedValue)).Float64(),nil// #nosec G404 // Only used for generating a random number from static string, no need for cryptographic safety
}
funcstringToSeed(sstring)(int64,error){
hash:=md5.New()// #nosec G401 // Unly used to convert a string into a numer, no need for cryptographic safety
if_,err:=fmt.Fprint(hash,s);err!=nil{
return0,errors.Wrap(err,"writing string to hasher")
}
var(
hashSum=hash.Sum(nil)
sumint64
)
fori:=0;i<len(hashSum);i++{
sum+=int64(float64(hashSum[len(hashSum)-1-i]%10)*math.Pow(10,float64(i)))//nolint:gomnd // No need to put the 10 of 10**i into a constant named "ten"