- From: Cedric Vivier <cedricv@neonux.com>
- Date: Sun, 6 Feb 2011 12:07:10 +0800
On Sun, Feb 6, 2011 at 11:34, Roger H?gensen <rescator at emsai.net> wrote: > But getRandomValues(in ArrayBufferView data) seem to indicate that each byte > (value) is random, limited to an array of 8bit data?. In the context of typed arrays, a value depends of the type of the ArrayBufferView. ArrayBufferView are interchangable using the same ArrayBuffer (the actual underlying bytes). Passing an Uint8Array will give you random Uint8 values at each index of the array, passing an Int32Array will give you random Int32 values at each index of the array as well. Technically the implementation is the same for any integer array : filling the underlying array buffer (bytes) with random data, eg : read(FD("/dev/random"), PTR(arraybufferview->data), arraybufferview->byteLength) Regards,
Received on Saturday, 5 February 2011 20:07:10 UTC