php2go icon indicating copy to clipboard operation
php2go copied to clipboard

能否实现一个 php 的 random_bytes

Open chenxi2015 opened this issue 3 years ago • 3 comments

chenxi2015 avatar Apr 27 '22 06:04 chenxi2015

@chenxi2015 random_bytes?A: RandomBytes

awesee avatar Apr 27 '22 07:04 awesee

这个 random_bytes 的方法 跟php的函数实现的不一样,这个不随机

chenxi2015 avatar Apr 27 '22 08:04 chenxi2015

@chenxi2015 你认真测一下,随机的。注意是 crypto/rand.Read() 不是 math/rand.Read()

awesee avatar Apr 28 '22 07:04 awesee