Skip to content

Commit

Permalink
Use WebIDL's operations on ArrayBufferViews in getRandomValues
Browse files Browse the repository at this point in the history
  • Loading branch information
twiss committed Jan 7, 2025
1 parent 1a2a431 commit f08c702
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions spec/Overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -856,15 +856,29 @@ <h4>The getRandomValues method</h4>
</li>
<li>
<p>
If the `byteLength` of |array| is greater than 65536, [= exception/throw =] a
Let |byteLength| be the [= BufferSource/byte length =] of |array|.
</p>
</li>
<li>
<p>
If |byteLength| is greater than 65536, [= exception/throw =] a
{{QuotaExceededError}} and
[= terminate the algorithm =].
</p>
</li>
<li>
<p>
Overwrite all elements of |array| with cryptographically strong random values of
the appropriate type.
Let |bytes| be a [= byte sequence =] of length |byteLength|.
</p>
</li>
<li>
<p>
Fill |bytes| with cryptographically secure random bytes.
</p>
</li>
<li>
<p>
[= ArrayBufferView/Write =] |bytes| into |array|.
</p>
</li>
<li>
Expand Down

0 comments on commit f08c702

Please sign in to comment.