Skip to content

Commit

Permalink
Some more random load
Browse files Browse the repository at this point in the history
  • Loading branch information
antweiss committed Aug 21, 2024
1 parent 7218bb3 commit ebd751e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ func encrypt(c *gin.Context) {
return
}

go func() {
runtime.LockOSThread()
// Generate a random string of 320000 bytes
_, _ = GenerateRandomString(320000)
time.Sleep(1 * time.Second)

}()

key, err := hex.DecodeString(secretKey)
if err != nil {
panic(err)
Expand Down Expand Up @@ -136,7 +144,6 @@ func main() {
now := time.Now()

if now.Sub(start) > 30*time.Second {
_, _ = GenerateRandomString(320000)
secretKey, _ = GenerateRandomString(32)
timestamp = strconv.FormatInt(now.Unix(), 16)
log.Print("Time passed, generating a new secret key ", secretKey)
Expand Down

0 comments on commit ebd751e

Please sign in to comment.