Skip to content

Commit

Permalink
Remove a comment relating to CryptoJS
Browse files Browse the repository at this point in the history
Preparation for #1239 (removing CryptoJS dependency).
  • Loading branch information
lawrence-forooghian committed Jun 13, 2023
1 parent a8c23d6 commit c61070a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/common/lib/util/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,9 @@ export const randomString = (numBytes: number): string => {
(Platform.Config.getRandomValues as Function)(uIntArr);
return Platform.BufferUtils.base64Encode(uIntArr);
}
/* Old browser; fall back to Math.random. Could just use a
* CryptoJS version of the above, but want this to still work in nocrypto
* versions of the library */
/* No secure random generator available; fall back to Math.random.
* TODO we should no longer end up in this scenario — and hence should be able to remove this code — given that all supported platforms should now have a random generator — see https://github.com/ably/ably-js/issues/1332
*/
const charset = Platform.BufferUtils.base64CharSet;
/* base64 has 33% overhead; round length up */
const length = Math.round((numBytes * 4) / 3);
Expand Down

0 comments on commit c61070a

Please sign in to comment.