<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Random string generator</title>
	<atom:link href="http://awads.net/wp/2005/07/28/random-string-generator/feed/" rel="self" type="application/rss+xml" />
	<link>http://awads.net/wp/2005/07/28/random-string-generator/</link>
	<description>News, views, tips and tricks on Oracle and other fun stuff</description>
	<pubDate>Tue, 07 Oct 2008 06:40:44 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: Eddie Awad</title>
		<link>http://awads.net/wp/2005/07/28/random-string-generator/#comment-325</link>
		<dc:creator>Eddie Awad</dc:creator>
		<pubDate>Tue, 22 Nov 2005 20:52:03 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=87#comment-325</guid>
		<description>&lt;p&gt;edcas, the seed is needed to generate the random number or string. The seed can be a number or a string. If you do not initialize the generator by explicitly calling the seed procedure, a default seed is used, in that case, it is equal to:&lt;/p&gt;

&lt;pre&gt;
TO_CHAR(SYSDATE,'MM-DD-YYYY HH24:MI:SS') &#124;&#124;
USER &#124;&#124; USERENV('SESSIONID')
&lt;/pre&gt;

&lt;p&gt;So, if you do not seed, and then call dbms_random.value, chances are you will not get the same random value.&lt;/p&gt;

&lt;p&gt;The dbms_random package specification says: &lt;em&gt;If this package is seeded twice with the same seed, then accessed in the same way, it will produce the same results in both cases.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;So, your observation is correct, given the same seed over and over again, you will get the same result each time you execute the same dbms_random procedure.&lt;/p&gt;

&lt;p&gt;How can a seed be used? well, one example is when you want to generate a random password. You would seed the generator with the username, so distinct usernames will have distinct random passwords, but same usernames will have the same random password since the seed (username) is the same.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>edcas, the seed is needed to generate the random number or string. The seed can be a number or a string. If you do not initialize the generator by explicitly calling the seed procedure, a default seed is used, in that case, it is equal to:</p>
<pre>
TO_CHAR(SYSDATE,'MM-DD-YYYY HH24:MI:SS') ||
USER || USERENV('SESSIONID')
</pre>
<p>So, if you do not seed, and then call dbms_random.value, chances are you will not get the same random value.</p>
<p>The dbms_random package specification says: <em>If this package is seeded twice with the same seed, then accessed in the same way, it will produce the same results in both cases.</em></p>
<p>So, your observation is correct, given the same seed over and over again, you will get the same result each time you execute the same dbms_random procedure.</p>
<p>How can a seed be used? well, one example is when you want to generate a random password. You would seed the generator with the username, so distinct usernames will have distinct random passwords, but same usernames will have the same random password since the seed (username) is the same.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: edcas</title>
		<link>http://awads.net/wp/2005/07/28/random-string-generator/#comment-322</link>
		<dc:creator>edcas</dc:creator>
		<pubDate>Tue, 22 Nov 2005 07:50:37 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=87#comment-322</guid>
		<description>&lt;p&gt;Hi Eddie,&lt;/p&gt;

&lt;p&gt;I can't really figure out what's the use for SEED procedure here. Can you explain further? &lt;/p&gt;

&lt;p&gt;As I execute the code below, it give me the same result.&lt;/p&gt;

&lt;pre&gt;
BEGIN
dbms_random.seed(1234535678);
dbms_output.put_line('Random1: '&#124;&#124;dbms_random.value);
END;

Random1: .62004818671882084550610341425311827476
&lt;/pre&gt;
</description>
		<content:encoded><![CDATA[<p>Hi Eddie,</p>
<p>I can&#8217;t really figure out what&#8217;s the use for SEED procedure here. Can you explain further? </p>
<p>As I execute the code below, it give me the same result.</p>
<pre>
BEGIN
dbms_random.seed(1234535678);
dbms_output.put_line('Random1: '||dbms_random.value);
END;

Random1: .62004818671882084550610341425311827476
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie</title>
		<link>http://awads.net/wp/2005/07/28/random-string-generator/#comment-42</link>
		<dc:creator>Eddie</dc:creator>
		<pubDate>Fri, 29 Jul 2005 18:38:38 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=87#comment-42</guid>
		<description>Robert,
I could not understand your problem. However, here are some clarifications about the package &lt;code&gt;DBMS_RANDOM&lt;/code&gt; which I'm sure you already know, but does not hurt to add them here for future reference:

The package &lt;code&gt;DBMS\_RANDOM&lt;/code&gt; is only available in Oracle version 8 and above.

If you want to encrypt sensitive data, then you should use the built-in package &lt;code&gt;DBMS\_OBFUSCATION\_TOOLKIT&lt;/code&gt;, not &lt;code&gt;DBMS\_RANDOM&lt;/code&gt; .

For an analysis of &lt;code&gt;DBMS\_RANDOM&lt;/code&gt;, how it works and the quality of the generated random numbers or strings, I suggest &lt;a href="http://www.dbasupport.com/oracle/ora9i/unwrappingDBMS01_01.shtml" rel="nofollow"&gt;this&lt;/a&gt; article.

The following functions are not documented in &lt;a href="http://download-west.oracle.com/docs/cd/A87860_01/doc/appdev.817/a76936/dbms_ra2.htm" rel="nofollow"&gt;Oracle 8i&lt;/a&gt; and &lt;a href="http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96612/d_rando2.htm" rel="nofollow"&gt;Oracle 9i&lt;/a&gt; &lt;code&gt;DBMS\_RANDOM&lt;/code&gt;'s documentation, but they are in &lt;a href="http://download-west.oracle.com/docs/cd/B14117_01/appdev.101/b10802/d_random.htm#ARPLS040" rel="nofollow"&gt;Oracle 10g&lt;/a&gt;'s: &lt;code&gt;NORMAL&lt;/code&gt;, &lt;code&gt;VALUE&lt;/code&gt; and &lt;code&gt;STRING&lt;/code&gt;. A look at the source code of &lt;code&gt;DBMS\_RANDOM&lt;/code&gt; reveals these hidden and useful functions. 
</description>
		<content:encoded><![CDATA[<p>Robert,<br />
I could not understand your problem. However, here are some clarifications about the package <code>DBMS_RANDOM</code> which I&#8217;m sure you already know, but does not hurt to add them here for future reference:</p>
<p>The package <code>DBMS\_RANDOM</code> is only available in Oracle version 8 and above.</p>
<p>If you want to encrypt sensitive data, then you should use the built-in package <code>DBMS\_OBFUSCATION\_TOOLKIT</code>, not <code>DBMS\_RANDOM</code> .</p>
<p>For an analysis of <code>DBMS\_RANDOM</code>, how it works and the quality of the generated random numbers or strings, I suggest <a href="http://www.dbasupport.com/oracle/ora9i/unwrappingDBMS01_01.shtml" rel="nofollow">this</a> article.</p>
<p>The following functions are not documented in <a href="http://download-west.oracle.com/docs/cd/A87860_01/doc/appdev.817/a76936/dbms_ra2.htm" rel="nofollow">Oracle 8i</a> and <a href="http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96612/d_rando2.htm" rel="nofollow">Oracle 9i</a> <code>DBMS\_RANDOM</code>&#8217;s documentation, but they are in <a href="http://download-west.oracle.com/docs/cd/B14117_01/appdev.101/b10802/d_random.htm#ARPLS040" rel="nofollow">Oracle 10g</a>&#8217;s: <code>NORMAL</code>, <code>VALUE</code> and <code>STRING</code>. A look at the source code of <code>DBMS\_RANDOM</code> reveals these hidden and useful functions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Vollman</title>
		<link>http://awads.net/wp/2005/07/28/random-string-generator/#comment-41</link>
		<dc:creator>Robert Vollman</dc:creator>
		<pubDate>Fri, 29 Jul 2005 15:47:50 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=87#comment-41</guid>
		<description>Speaking of random numbers, what do you think about this problem of mine:

http://thinkoracle.blogspot.com/2005/05/random-numbers.html</description>
		<content:encoded><![CDATA[<p>Speaking of random numbers, what do you think about this problem of mine:</p>
<p><a href="http://thinkoracle.blogspot.com/2005/05/random-numbers.html" rel="nofollow">http://thinkoracle.blogspot.com/2005/05/random-numbers.html</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
