Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Commit

Permalink
add comment for iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
kwgithubusername committed Feb 3, 2016
1 parent 157e7cf commit 80ad7d3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/rng.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ RNG.prototype.run = function (sizeBytes, callback) {
try {
var b = sizeBytes ? sizeBytes : this.BYTES;
var serverH = this.getServerEntropy(b);
// in iOS, every() cannot be called on a Buffer object, so use Array.prototype.every.call(sizeBytes, f)

This comment has been minimized.

Copy link
@jtormey

jtormey Feb 3, 2016

Contributor

This is also the case in Node. The official Buffer spec does not include every. The only array-like method it does have is slice.

assert(!Array.prototype.every.call(serverH, function(byte){return byte === serverH[0]}), 'The server entropy should not be the same byte repeated.');
var localH = randomBytes(b, callback);
assert(!Array.prototype.every.call(localH, function(byte){return byte === localH[0]}), 'The browser entropy should not be the same byte repeated.');
Expand Down

0 comments on commit 80ad7d3

Please sign in to comment.