Rev | Line | |
---|
[483] | 1 | define(["dojo"], function(dojo) { |
---|
| 2 | |
---|
| 3 | return dojo.declare("dojox.math.random.Simple", null, { |
---|
| 4 | // summary: |
---|
| 5 | // Super simple implementation of a random number generator, |
---|
| 6 | // which relies on Math.random(). |
---|
| 7 | |
---|
| 8 | destroy: function(){ |
---|
| 9 | // summary: |
---|
| 10 | // Prepares the object for GC. (empty in this case) |
---|
| 11 | }, |
---|
| 12 | |
---|
| 13 | nextBytes: function(/* Array */ byteArray){ |
---|
| 14 | // summary: |
---|
| 15 | // Fills in an array of bytes with random numbers |
---|
| 16 | // byteArray: Array |
---|
| 17 | // array to be filled in with random numbers, only existing |
---|
| 18 | // elements will be filled. |
---|
| 19 | for(var i = 0, l = byteArray.length; i < l; ++i){ |
---|
| 20 | byteArray[i] = Math.floor(256 * Math.random()); |
---|
| 21 | } |
---|
| 22 | } |
---|
| 23 | }); |
---|
| 24 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.