<commit_before>---
published: true
---


---
layout: article
title: "Generate-a-Random-Password-in-PHP"
modified:
categories: codes
excerpt:
tags: []
image:
  feature:
  teaser:
  thumb:
date: 2015-05-24T20:46:03+08:00
---

{% highlight php startinline %}
$chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()';
for($i = 0; $i < 10; $i++) {
    $str .= substr($chars, rand(0, 1000) % strlen($chars), 1);
}
echo $str."\n";
{% endhighlight %}
<commit_msg>DEL: remove dirty codes<commit_after>---
layout: article
title: "Generate-a-Random-Password-in-PHP"
modified:
categories: codes
excerpt:
tags: []
image:
  feature:
  teaser:
  thumb:
date: 2015-05-24T20:46:03+08:00
---

{% highlight php startinline %}
$chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()';
for($i = 0; $i < 10; $i++) {
    $str .= substr($chars, rand(0, 1000) % strlen($chars), 1);
}
echo $str."\n";
{% endhighlight %}

{'fraction_non_alphanumeric': 0.20464135021097046, 'fraction_numerical': 0.07805907172995781, 'mean_word_length': 4.716867469879518, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2140728', 'n_tokens_mistral': 460, 'n_tokens_neox': 385, 'n_words': 75}