PHP 会话在存储 id 时使用什么哈希?
算法是什么.我想使用相同的算法手动创建我自己的 session_ids,我也想将其存储在本地.
What is the algorithm. I would like to use the same algorithm to manually create my own session_ids which I want to store locally as well.
我意识到我可以在服务器端创建它(使用会话函数)并发送它...但我更喜欢自己对它进行散列/编码...+我想要增加我喜欢的复杂性的选项...摆弄它等
I realize I could create it server side ( using session functions ) and send it...but I just prefer to hash / encode it myself...+ I want the option to increase the complexity to my liking...fiddle with it etc.
相关:1
谢谢.
PHP 默认使用 md5,但可以配置为使用 sha-1 以及从 PHP 5.3 开始的许多其他散列算法.
PHP uses md5 by default, but can be configured to use sha-1 and as of PHP 5.3 many other hashing algorithms.
您可以选择自己的算法,但它至少应该与 md5 一样强大,并且可能应该更强大,因为 md5 有点过时了.
You can choose your own algorithm, but it should be at least as strong as md5 and probably should be stronger as md5 is getting a bit out of date.