Skip to content

Commit

Permalink
Merge pull request #73 from awesee/develop
Browse files Browse the repository at this point in the history
A: RandomBytes
  • Loading branch information
Shuo authored Apr 27, 2022
2 parents 5eed998 + e65faa2 commit c9a5b01
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions php/random_bytes.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package php

import "crypto/rand"

// RandomBytes — Generates cryptographically secure pseudo-random bytes
func RandomBytes(len int) []byte {
b := make([]byte, len)
_, _ = rand.Read(b)
return b
}

0 comments on commit c9a5b01

Please sign in to comment.