1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-23 20:15:19 -07:00

Support for Cloudflare Workers for javascript_stir (#1401)

* Support for Cloudflare Workers for javascript_stir

* Ramove debugging comment

---------

Co-authored-by: Frank Denis <124872+jedisct1@users.noreply.github.com>
This commit is contained in:
mschwarzl 2024-08-13 21:40:10 +02:00 committed by GitHub
parent 01379fe68c
commit 1012bbc380
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -57,6 +57,7 @@ javascript_stir(void)
try { try {
var window_ = 'object' === typeof window ? window : self; var window_ = 'object' === typeof window ? window : self;
var crypto_ = typeof window_.crypto !== 'undefined' ? window_.crypto : window_.msCrypto; var crypto_ = typeof window_.crypto !== 'undefined' ? window_.crypto : window_.msCrypto;
crypto_ = (crypto_ === undefined) ? crypto : crypto_;
var randomValuesStandard = function() { var randomValuesStandard = function() {
var buf = new Uint32Array(1); var buf = new Uint32Array(1);
crypto_.getRandomValues(buf); crypto_.getRandomValues(buf);