• <bdo id='A7Ty5'></bdo><ul id='A7Ty5'></ul>
    <i id='A7Ty5'><tr id='A7Ty5'><dt id='A7Ty5'><q id='A7Ty5'><span id='A7Ty5'><b id='A7Ty5'><form id='A7Ty5'><ins id='A7Ty5'></ins><ul id='A7Ty5'></ul><sub id='A7Ty5'></sub></form><legend id='A7Ty5'></legend><bdo id='A7Ty5'><pre id='A7Ty5'><center id='A7Ty5'></center></pre></bdo></b><th id='A7Ty5'></th></span></q></dt></tr></i><div id='A7Ty5'><tfoot id='A7Ty5'></tfoot><dl id='A7Ty5'><fieldset id='A7Ty5'></fieldset></dl></div>

    1. <tfoot id='A7Ty5'></tfoot>

        <small id='A7Ty5'></small><noframes id='A7Ty5'>

        <legend id='A7Ty5'><style id='A7Ty5'><dir id='A7Ty5'><q id='A7Ty5'></q></dir></style></legend>

        如何使用 PHP 生成密码安全的随机数?

        How do you generate cryptographically secure random numbers with PHP?(如何使用 PHP 生成密码安全的随机数?)
            <tbody id='5N3Vm'></tbody>

          <tfoot id='5N3Vm'></tfoot><legend id='5N3Vm'><style id='5N3Vm'><dir id='5N3Vm'><q id='5N3Vm'></q></dir></style></legend>

          <small id='5N3Vm'></small><noframes id='5N3Vm'>

                <bdo id='5N3Vm'></bdo><ul id='5N3Vm'></ul>
                • <i id='5N3Vm'><tr id='5N3Vm'><dt id='5N3Vm'><q id='5N3Vm'><span id='5N3Vm'><b id='5N3Vm'><form id='5N3Vm'><ins id='5N3Vm'></ins><ul id='5N3Vm'></ul><sub id='5N3Vm'></sub></form><legend id='5N3Vm'></legend><bdo id='5N3Vm'><pre id='5N3Vm'><center id='5N3Vm'></center></pre></bdo></b><th id='5N3Vm'></th></span></q></dt></tr></i><div id='5N3Vm'><tfoot id='5N3Vm'></tfoot><dl id='5N3Vm'><fieldset id='5N3Vm'></fieldset></dl></div>
                  本文介绍了如何使用 PHP 生成密码安全的随机数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  可能重复:
                  在 PHP 中安全随机数生成

                  我们需要生成一个加密随机字符串用作身份验证令牌,它将与数据库中的会话数据相关联.我们正在使用 PHP,它似乎没有内置合适的随机数生成器.我们如何使用 php 生成长度为 N 的密码安全随机字符串?

                  We need to generate a cryptographically random string to use as an authentication token, which will be tied to session data in the database. We are using PHP, which doesn't appear to have a suitable random number generator built-in. How can we generate a cryptographically secure random string of N length using php?

                  另外请注意,由于我们应用程序的性质,shell_exec 不适用.

                  Also note, due to the nature of our application, shell_exec is off the table.

                  推荐答案

                  uniqid?文档有一个如何将其用于 cookie/会话的示例.

                  what about uniqid? docs have an example of how it can be used for cookies/sessions.

                  这篇关于如何使用 PHP 生成密码安全的随机数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  PHP Upload File Validation(PHP 上传文件验证)
                  PHP Error - Uploading a file(PHP 错误 - 上传文件)
                  How can I write tests for file upload in PHP?(如何在 PHP 中编写文件上传测试?)
                  php resizing image on upload rotates the image when i don#39;t want it to(php在上传时调整图像大小会在我不想要它时旋转图像)
                  How to send additional data using PLupload?(如何使用 PLupload 发送附加数据?)
                  change button text in js/ajax after mp4 =gt;mp3 conversion in php(在 php 中的 mp4 =gt;mp3 转换后更改 js/ajax 中的按钮文本)

                  • <small id='neKA5'></small><noframes id='neKA5'>

                    <i id='neKA5'><tr id='neKA5'><dt id='neKA5'><q id='neKA5'><span id='neKA5'><b id='neKA5'><form id='neKA5'><ins id='neKA5'></ins><ul id='neKA5'></ul><sub id='neKA5'></sub></form><legend id='neKA5'></legend><bdo id='neKA5'><pre id='neKA5'><center id='neKA5'></center></pre></bdo></b><th id='neKA5'></th></span></q></dt></tr></i><div id='neKA5'><tfoot id='neKA5'></tfoot><dl id='neKA5'><fieldset id='neKA5'></fieldset></dl></div>

                        <bdo id='neKA5'></bdo><ul id='neKA5'></ul>
                      • <tfoot id='neKA5'></tfoot>
                          <tbody id='neKA5'></tbody>
                        • <legend id='neKA5'><style id='neKA5'><dir id='neKA5'><q id='neKA5'></q></dir></style></legend>