Generate cryptographically secure random numbers in php

后端 未结 16 1682
孤街浪徒
孤街浪徒 2020-11-29 07:39

PHP\'s rand() function doesn\'t give good random numbers. So I started to use mt_rand() which is said to give better results. But how good are thes

16条回答
  •  误落风尘
    2020-11-29 08:00

    If you don't like PHP's built in rand(), you probably shouldn't use their built-in shuffle() either, since it seems to be built on their rand().

    I am halfway sure the "industry standard" shuffle now is the Fisher-Yates shuffle.

提交回复
热议问题