UNPKG

random-of

Version:

random number, random string and random iterator

694 lines (219 loc) 8.79 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Global</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Global</h1> <section> <header> <h2> </h2> </header> <article> <div class="container-overview"> <dl class="details"> </dl> </div> <h3 class="subsection-title">Members</h3> <dl> <dt> <h4 class="name" id="defaultCharts"><span class="type-signature"></span>defaultCharts<span class="type-signature"></span></h4> </dt> <dd> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line8">line 8</a> </li></ul></dd> </dl> </dd> </dl> <h3 class="subsection-title">Methods</h3> <dl> <dt> <h4 class="name" id="random"><span class="type-signature"></span>random<span class="signature">(max, min<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {number}</span></h4> </dt> <dd> <div class="description"> 生成一个区间内的随机数 </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>max</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="attributes"> </td> <td class="description last">最大值</td> </tr> <tr> <td class="name"><code>min</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">最小值</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line18">line 18</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> this value between the max and min; </div> <dl> <dt> Type </dt> <dd> <span class="param-type">number</span> </dd> </dl> </dd> <dt> <h4 class="name" id="randomStr"><span class="type-signature"></span>randomStr<span class="signature">(len<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {string}</span></h4> </dt> <dd> <div class="description"> 生成包含[a-zA-Z0-9]的指定长度的随机字符串 </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>len</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">指定长度,默认为 10;</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line42">line 42</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> this string include the [a-z0-9] and length is len </div> <dl> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> </dd> <dt> <h4 class="name" id="randomStrLimit"><span class="type-signature"></span>randomStrLimit<span class="signature">(len, charts<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {string}</span></h4> </dt> <dd> <div class="description"> 生成包含charts指定集合内字符的指定长度的随机字符串 </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>len</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="attributes"> </td> <td class="description last">指定长度,默认为 10;</td> </tr> <tr> <td class="name"><code>charts</code></td> <td class="type"> <span class="param-type">charts</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">指定长度,默认为 10;</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line59">line 59</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> </dd> </dl> </article> </section> </div> <nav> <h2><a href="index.html">Index</a></h2><h3>Classes</h3><ul><li><a href="Iterator.html">Iterator</a></li><li><a href="RandomIterator.html">RandomIterator</a></li><li><a href="RollingIterator.html">RollingIterator</a></li></ul><h3>Global</h3><ul><li><a href="global.html#defaultCharts">defaultCharts</a></li><li><a href="global.html#random">random</a></li><li><a href="global.html#randomStr">randomStr</a></li><li><a href="global.html#randomStrLimit">randomStrLimit</a></li></ul> </nav> <br clear="both"> <footer> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a> on Mon Nov 17 2014 20:29:51 GMT+0800 (CST) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>