UNPKG

13.7 kBHTMLView Raw
1<!DOCTYPE html>
2
3<html lang="en">
4<head>
5 <meta charset="utf-8">
6 <meta name="viewport" content="width=device-width">
7 <title>Documentation Namespace: random</title>
8
9 <!--[if lt IE 9]>
10 <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
11 <![endif]-->
12 <link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
13
14 <link type="text/css" rel="stylesheet" href="styles/site.simplex.css">
15
16</head>
17
18<body>
19
20<div class="navbar navbar-default navbar-fixed-top ">
21<div class="container">
22 <div class="navbar-header">
23 <a class="navbar-brand" href="index.html">Documentation</a>
24 <button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation">
25 <span class="icon-bar"></span>
26 <span class="icon-bar"></span>
27 <span class="icon-bar"></span>
28 </button>
29 </div>
30 <div class="navbar-collapse collapse" id="topNavigation">
31 <ul class="nav navbar-nav">
32
33 <li class="dropdown">
34 <a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b class="caret"></b></a>
35 <ul class="dropdown-menu ">
36 <li><a href="faker.html">faker</a></li><li><a href="faker.address.html">faker.address</a></li><li><a href="faker.commerce.html">faker.commerce</a></li><li><a href="faker.company.html">faker.company</a></li><li><a href="faker.date.html">faker.date</a></li><li><a href="faker.finance.html">faker.finance</a></li><li><a href="faker.hacker.html">faker.hacker</a></li><li><a href="faker.helpers.html">faker.helpers</a></li><li><a href="faker.image.html">faker.image</a></li><li><a href="faker.internet.html">faker.internet</a></li><li><a href="faker.lorem.html">faker.lorem</a></li><li><a href="faker.name.html">faker.name</a></li><li><a href="faker.phone.html">faker.phone</a></li><li><a href="faker.random.html">faker.random</a></li><li><a href="faker.system.html">faker.system</a></li>
37 </ul>
38 </li>
39
40 </ul>
41 <div class="col-sm-3 col-md-3">
42 <form class="navbar-form" role="search">
43 <div class="input-group">
44 <input type="text" class="form-control" placeholder="Search" name="q" id="search-input">
45 <div class="input-group-btn">
46 <button class="btn btn-default" id="search-submit"><i class="glyphicon glyphicon-search"></i></button>
47 </div>
48 </div>
49 </form>
50 </div>
51 </div>
52
53</div>
54</div>
55
56
57<div class="container" id="toc-content">
58<div class="row">
59
60
61 <div class="col-md-8">
62
63 <div id="main">
64
65
66 <h1 class="page-title">Namespace: random</h1>
67<section>
68
69<header>
70
71 <h2>
72 <span class="ancestors"><a href="faker.html">faker</a>.</span>
73
74 random
75 </h2>
76
77
78</header>
79
80
81<article>
82 <div class="container-overview">
83
84
85
86
87<dl class="details">
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123</dl>
124
125
126
127
128 </div>
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143 <h3 class="subsection-title">Methods</h3>
144
145 <dl>
146
147<hr>
148<dt>
149 <h4 class="name" id=".alphaNumeric"><span class="type-signature">&lt;static> </span>alphaNumeric()</h4>
150
151
152</dt>
153<dd>
154
155
156 <div class="description">
157 <p>alphaNumeric</p>
158 </div>
159
160
161
162
163
164
165
166
167
168
169<dl class="details">
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205</dl>
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221</dd>
222
223
224
225<hr>
226<dt>
227 <h4 class="name" id=".arrayElement"><span class="type-signature">&lt;static> </span>arrayElement(array)</h4>
228
229
230</dt>
231<dd>
232
233
234 <div class="description">
235 <p>takes an array and returns a random element of the array</p>
236 </div>
237
238
239
240
241
242
243
244
245 <h5>Parameters:</h5>
246
247
248<table class="params table table-striped">
249 <thead>
250 <tr>
251
252 <th>Name</th>
253
254
255 <th>Type</th>
256
257
258
259
260
261 <th class="last">Description</th>
262 </tr>
263 </thead>
264
265 <tbody>
266
267
268 <tr>
269
270 <td class="name"><code>array</code></td>
271
272
273 <td class="type">
274
275
276<span class="param-type">array</span>
277
278
279
280
281 </td>
282
283
284
285
286
287 <td class="description last"></td>
288 </tr>
289
290
291 </tbody>
292</table>
293
294
295
296
297<dl class="details">
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333</dl>
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349</dd>
350
351
352
353<hr>
354<dt>
355 <h4 class="name" id=".boolean"><span class="type-signature">&lt;static> </span>boolean()</h4>
356
357
358</dt>
359<dd>
360
361
362 <div class="description">
363 <p>boolean</p>
364 </div>
365
366
367
368
369
370
371
372
373
374
375<dl class="details">
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411</dl>
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427</dd>
428
429
430
431<hr>
432<dt>
433 <h4 class="name" id=".image"><span class="type-signature">&lt;static> </span>image()</h4>
434
435
436</dt>
437<dd>
438
439
440 <div class="description">
441 <p>locale</p>
442 </div>
443
444
445
446
447
448
449
450
451
452
453<dl class="details">
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489</dl>
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505</dd>
506
507
508
509<hr>
510<dt>
511 <h4 class="name" id=".locale"><span class="type-signature">&lt;static> </span>locale()</h4>
512
513
514</dt>
515<dd>
516
517
518 <div class="description">
519 <p>locale</p>
520 </div>
521
522
523
524
525
526
527
528
529
530
531<dl class="details">
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567</dl>
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583</dd>
584
585
586
587<hr>
588<dt>
589 <h4 class="name" id=".number"><span class="type-signature">&lt;static> </span>number(options)</h4>
590
591
592</dt>
593<dd>
594
595
596 <div class="description">
597 <p>returns a single random number based on a max number or range</p>
598 </div>
599
600
601
602
603
604
605
606
607 <h5>Parameters:</h5>
608
609
610<table class="params table table-striped">
611 <thead>
612 <tr>
613
614 <th>Name</th>
615
616
617 <th>Type</th>
618
619
620
621
622
623 <th class="last">Description</th>
624 </tr>
625 </thead>
626
627 <tbody>
628
629
630 <tr>
631
632 <td class="name"><code>options</code></td>
633
634
635 <td class="type">
636
637
638<span class="param-type">mixed</span>
639
640
641
642
643 </td>
644
645
646
647
648
649 <td class="description last"></td>
650 </tr>
651
652
653 </tbody>
654</table>
655
656
657
658
659<dl class="details">
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695</dl>
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711</dd>
712
713
714
715<hr>
716<dt>
717 <h4 class="name" id=".objectElement"><span class="type-signature">&lt;static> </span>objectElement(object, field)</h4>
718
719
720</dt>
721<dd>
722
723
724 <div class="description">
725 <p>takes an object and returns the randomly key or value</p>
726 </div>
727
728
729
730
731
732
733
734
735 <h5>Parameters:</h5>
736
737
738<table class="params table table-striped">
739 <thead>
740 <tr>
741
742 <th>Name</th>
743
744
745 <th>Type</th>
746
747
748
749
750
751 <th class="last">Description</th>
752 </tr>
753 </thead>
754
755 <tbody>
756
757
758 <tr>
759
760 <td class="name"><code>object</code></td>
761
762
763 <td class="type">
764
765
766<span class="param-type">object</span>
767
768
769
770
771 </td>
772
773
774
775
776
777 <td class="description last"></td>
778 </tr>
779
780
781
782 <tr>
783
784 <td class="name"><code>field</code></td>
785
786
787 <td class="type">
788
789
790<span class="param-type">mixed</span>
791
792
793
794
795 </td>
796
797
798
799
800
801 <td class="description last"></td>
802 </tr>
803
804
805 </tbody>
806</table>
807
808
809
810
811<dl class="details">
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847</dl>
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863</dd>
864
865
866
867<hr>
868<dt>
869 <h4 class="name" id=".uuid"><span class="type-signature">&lt;static> </span>uuid()</h4>
870
871
872</dt>
873<dd>
874
875
876 <div class="description">
877 <p>uuid</p>
878 </div>
879
880
881
882
883
884
885
886
887
888
889<dl class="details">
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925</dl>
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941</dd>
942
943
944
945<hr>
946<dt>
947 <h4 class="name" id=".word"><span class="type-signature">&lt;static> </span>word(type)</h4>
948
949
950</dt>
951<dd>
952
953
954 <div class="description">
955 <p>word</p>
956 </div>
957
958
959
960
961
962
963
964
965 <h5>Parameters:</h5>
966
967
968<table class="params table table-striped">
969 <thead>
970 <tr>
971
972 <th>Name</th>
973
974
975 <th>Type</th>
976
977
978
979
980
981 <th class="last">Description</th>
982 </tr>
983 </thead>
984
985 <tbody>
986
987
988 <tr>
989
990 <td class="name"><code>type</code></td>
991
992
993 <td class="type">
994
995
996<span class="param-type">string</span>
997
998
999
1000
1001 </td>
1002
1003
1004
1005
1006
1007 <td class="description last"></td>
1008 </tr>
1009
1010
1011 </tbody>
1012</table>
1013
1014
1015
1016
1017<dl class="details">
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053</dl>
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069</dd>
1070
1071
1072
1073<hr>
1074<dt>
1075 <h4 class="name" id=".words"><span class="type-signature">&lt;static> </span>words(count)</h4>
1076
1077
1078</dt>
1079<dd>
1080
1081
1082 <div class="description">
1083 <p>randomWords</p>
1084 </div>
1085
1086
1087
1088
1089
1090
1091
1092
1093 <h5>Parameters:</h5>
1094
1095
1096<table class="params table table-striped">
1097 <thead>
1098 <tr>
1099
1100 <th>Name</th>
1101
1102
1103 <th>Type</th>
1104
1105
1106
1107
1108
1109 <th class="last">Description</th>
1110 </tr>
1111 </thead>
1112
1113 <tbody>
1114
1115
1116 <tr>
1117
1118 <td class="name"><code>count</code></td>
1119
1120
1121 <td class="type">
1122
1123
1124<span class="param-type">number</span>
1125
1126
1127
1128
1129 </td>
1130
1131
1132
1133
1134
1135 <td class="description last"><p>defaults to a random value between 1 and 3</p></td>
1136 </tr>
1137
1138
1139 </tbody>
1140</table>
1141
1142
1143
1144
1145<dl class="details">
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181</dl>
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197</dd>
1198
1199 </dl>
1200
1201
1202
1203
1204
1205</article>
1206
1207</section>
1208
1209
1210
1211
1212 </div>
1213 </div>
1214
1215 <div class="clearfix"></div>
1216
1217
1218 <div class="col-md-3">
1219 <div id="toc" class="col-md-3 hidden-xs hidden-sm hidden-md"></div>
1220 </div>
1221
1222
1223</div>
1224</div>
1225
1226<div class="modal fade" id="searchResults">
1227 <div class="modal-dialog">
1228 <div class="modal-content">
1229 <div class="modal-header">
1230 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
1231 <h4 class="modal-title">Search results</h4>
1232 </div>
1233 <div class="modal-body"></div>
1234 <div class="modal-footer">
1235 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
1236 </div>
1237 </div><!-- /.modal-content -->
1238 </div><!-- /.modal-dialog -->
1239</div>
1240
1241<footer>
1242
1243
1244<span class="jsdoc-message">
1245 Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a>
1246
1247 on 2016-03-20T21:12:53-04:00
1248
1249 using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
1250</span>
1251</footer>
1252
1253<script src="scripts/docstrap.lib.js"></script>
1254<script src="scripts/toc.js"></script>
1255<script type="text/javascript" src="scripts/fulltext-search-ui.js"></script>
1256
1257<script>
1258$( function () {
1259 $( "[id*='$']" ).each( function () {
1260 var $this = $( this );
1261
1262 $this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
1263 } );
1264
1265 $( ".tutorial-section pre, .readme-section pre" ).each( function () {
1266 var $this = $( this );
1267
1268 var example = $this.find( "code" );
1269 exampleText = example.html();
1270 var lang = /{@lang (.*?)}/.exec( exampleText );
1271 if ( lang && lang[1] ) {
1272 exampleText = exampleText.replace( lang[0], "" );
1273 example.html( exampleText );
1274 lang = lang[1];
1275 } else {
1276 var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/);
1277 lang = langClassMatch ? langClassMatch[1] : "javascript";
1278 }
1279
1280 if ( lang ) {
1281
1282 $this
1283 .addClass( "sunlight-highlight-" + lang )
1284 .addClass( "linenums" )
1285 .html( example.html() );
1286
1287 }
1288 } );
1289
1290 Sunlight.highlightAll( {
1291 lineNumbers : false,
1292 showMenu : true,
1293 enableDoclinks : true
1294 } );
1295
1296 $.catchAnchorLinks( {
1297 navbarOffset: 10
1298 } );
1299 $( "#toc" ).toc( {
1300 anchorName : function ( i, heading, prefix ) {
1301 var id = $( heading ).attr( "id" );
1302 return id && id.replace(/\~/g, '-inner-').replace(/\./g, '-static-') || ( prefix + i );
1303 },
1304 selectors : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4",
1305 showAndHide : false,
1306 smoothScrolling: true
1307 } );
1308
1309 $( "#main span[id^='toc']" ).addClass( "toc-shim" );
1310 $( '.dropdown-toggle' ).dropdown();
1311
1312 $( "table" ).each( function () {
1313 var $this = $( this );
1314 $this.addClass('table');
1315 } );
1316
1317} );
1318</script>
1319
1320
1321
1322<!--Navigation and Symbol Display-->
1323
1324
1325<!--Google Analytics-->
1326
1327
1328<script type="text/javascript">
1329 $(document).ready(function() {
1330 SearcherDisplay.init();
1331 });
1332</script>
1333
1334</body>
1335</html>
\No newline at end of file