<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>KADIMI [Web Dev, SEO, Linux...] &#187; Security</title>
	<atom:link href="http://www.kadimi.com/en/tag/security/feed" rel="self" type="application/rss+xml" />
	<link>http://www.kadimi.com/en</link>
	<description>Blog &#38; Free Tech Support</description>
	<lastBuildDate>Thu, 02 Sep 2010 21:22:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Generate passwords with JavaScript</title>
		<link>http://www.kadimi.com/en/random-password-string-107</link>
		<comments>http://www.kadimi.com/en/random-password-string-107#comments</comments>
		<pubDate>Sat, 06 Jun 2009 03:56:50 +0000</pubDate>
		<dc:creator>Nabil</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.kadimi.com/en/?p=107</guid>
		<description><![CDATA[The function generatePassword() is a simple yet customizable function that generates a random password string, the default password length is 6, you can override it by calling the function like this  generatePassword(n) where n is the password length. The possible characters are defined within the function with the variable chars function generatePassword(len){ len = parseInt(len); [...]]]></description>
			<content:encoded><![CDATA[<p><script src="http://www.kadimi.com/en/wp-content/uploads/generatePassword.js" type="text/javascript"></script><br />
The function <strong><code>generatePassword()</code></strong> is a simple yet customizable function that generates a random password string, the default password length is 6, you can override it by calling the function like this  <strong><code>generatePassword(n)</code></strong> where <strong><code>n</code></strong> is the password length. The possible characters are defined within the function with the variable <code>chars</code><span id="more-107"></span></p>
<blockquote>
<pre><code>function generatePassword(len){
	len	= parseInt(len);
	if(!len)
		len = 6;
	var password = "";
	var chars    = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
	var charsN   = chars.length;
	var nextChar;

	for(i=0;i&lt;len;i++){
		nextChar = chars.charAt(Math.floor(Math.random()*charsN));
		password += nextChar
	}
	return password;
}</code></pre>
</blockquote>
<p>Here is an example of calling the function:</p>
<blockquote>
<pre><code>pwdLen = 10;
window.alert("A random string of " + pwdLen + "characters: " + generatePassword(pwdLen));</code></pre>
</blockquote>
<h3>Try it</h3>
<p><a onclick="pass = generatePassword(8);alert(pass);return false;" href="#">Generate</a> a random password of 8 characters.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kadimi.com/en/random-password-string-107/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
