Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 25d2b15

Browse files
authored
Use WebIDL's operations on ArrayBufferViews in getRandomValues (#395)
1 parent 1a2a431 commit 25d2b15

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

spec/Overview.html

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -856,15 +856,29 @@ <h4>The getRandomValues method</h4>
856856
</li>
857857
<li>
858858
<p>
859-
If the `byteLength` of |array| is greater than 65536, [= exception/throw =] a
859+
Let |byteLength| be the [= BufferSource/byte length =] of |array|.
860+
</p>
861+
</li>
862+
<li>
863+
<p>
864+
If |byteLength| is greater than 65536, [= exception/throw =] a
860865
{{QuotaExceededError}} and
861866
[= terminate the algorithm =].
862867
</p>
863868
</li>
864869
<li>
865870
<p>
866-
Overwrite all elements of |array| with cryptographically strong random values of
867-
the appropriate type.
871+
Let |bytes| be a [= byte sequence =] of length |byteLength|.
872+
</p>
873+
</li>
874+
<li>
875+
<p>
876+
Fill |bytes| with cryptographically secure random bytes.
877+
</p>
878+
</li>
879+
<li>
880+
<p>
881+
[= ArrayBufferView/Write =] |bytes| into |array|.
868882
</p>
869883
</li>
870884
<li>

0 commit comments

Comments
 (0)