W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2011

[whatwg] Cryptographically strong random numbers

From: Roger Hågensen <rescator@emsai.net>
Date: Sun, 06 Feb 2011 08:10:41 +0100
Message-ID: <4D4E4971.3060305@emsai.net>
On 2011-02-06 05:07, Cedric Vivier wrote:
> 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.

Ah ok, so just fill the buffer/destination with random data. That sounds 
as good as and as flexible as one possibly can get.


-- 
Roger "Rescator" H?gensen.
Freelancer - http://www.EmSai.net/
Received on Saturday, 5 February 2011 23:10:41 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:30 UTC