Skip to content

Commit

Permalink
Bug/Random generator
Browse files Browse the repository at this point in the history
- Fixed bug with deprecated random generator seeding

Signed-off-by: Harold Wanyama <[email protected]>
  • Loading branch information
nickmango committed Nov 20, 2023
1 parent 271f918 commit 8de390b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cla-backend-go/v2/sign/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -883,10 +883,11 @@ func (s *service) populateSignURL(ctx context.Context,
}
}

// seed the random number generator
rand.Seed(time.Now().UnixNano())
// create a new source and rand object
src := rand.NewSource(time.Now().UnixNano())
r := rand.New(src) //nolint:gosec

randomInteger := rand.Intn(1000000) //nolint:gosec
randomInteger := r.Intn(1000000) //nolint:gosec
documentID := strconv.Itoa(randomInteger)

tab := getTabsFromDocument(&document, documentID, defaultValues)
Expand Down

0 comments on commit 8de390b

Please sign in to comment.