summaryrefslogtreecommitdiff
path: root/js/dojo/dojox/math/random/Simple.js
blob: 0061979982ff42b3217f3d298dc8c7933a3185f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//>>built
define("dojox/math/random/Simple", ["dojo"], function(dojo) {

	return dojo.declare("dojox.math.random.Simple", null, {
		// summary:
		//	Super simple implementation of a random number generator,
		//	which relies on Math.random().
	
		destroy: function(){
			// summary:
			//	Prepares the object for GC. (empty in this case)
		},
	
		nextBytes: function(/* Array */ byteArray){
			// summary:
			//	Fills in an array of bytes with random numbers
			// byteArray: Array:
			//	array to be filled in with random numbers, only existing
			//	elements will be filled.
			for(var i = 0, l = byteArray.length; i < l; ++i){
				byteArray[i] = Math.floor(256 * Math.random());
			}
		}
	});
});