6
6

More than 5 years have passed since last update.

phpコマンドでランダムなハッシュ値を生成する

Posted at


$ php -r "echo md5(mt_rand());"

  • -r オプションで、スクリプトタグ(<?php ?>)無しで実行。
  • md5()関数でハッシュ値を計算。
  • mt_rand()関数で、よりよい乱数値を生成。マニュアル

コマンドライン上に結果のハッシュ値が表示されます。

6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6