Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Way to use nacl in web workers #65

Closed
b1rdex opened this issue Jan 12, 2015 · 1 comment · Fixed by #87
Closed

Way to use nacl in web workers #65

b1rdex opened this issue Jan 12, 2015 · 1 comment · Fixed by #87
Assignees

Comments

@b1rdex
Copy link

b1rdex commented Jan 12, 2015

There is no window in web workers.
So the easiest way to fix this — replace window with self.

@jo
Copy link

jo commented Apr 11, 2015

I have used the follwing hack to work around this issue without having to touch tweetnacl itself:

var window = {}
importScripts('../vendor/nacl-fast.js')
var nacl = window.nacl

dchest added a commit that referenced this issue Feb 19, 2016
randombytes in browsers no longer throw when output length exceeds 65536
bytes. Remove mention of this from README.

Improve detection of environment (browser or Node) by also checking
process.browser.

Replace references to window with self. Fixes #65, closes #66.
dchest added a commit that referenced this issue Feb 19, 2016
randombytes in browsers no longer throw when output length exceeds 65536
bytes. Remove mention of this from README.

Improve detection of environment (browser or Node) by also checking
process.browser.

Replace references to window with self. Fixes #65, closes #66.
dchest added a commit that referenced this issue Feb 19, 2016
randombytes in browsers no longer throw when output length exceeds 65536
bytes. Remove mention of this from README.

Improve detection of environment (browser or Node) by also checking
process.browser.

Replace references to window with self. Fixes #65, closes #66.
dchest added a commit that referenced this issue Feb 20, 2016
randombytes in browsers no longer throw when output length exceeds 65536
bytes. Remove mention of this from README.

Improve detection of environment (browser or Node) by also checking
process.browser.

Replace references to window with self. Fixes #65, closes #66.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants