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

Support for Cloudflare Workers for javascript_stir #1401

Merged
merged 2 commits into from
Aug 13, 2024

Conversation

mschwarzl
Copy link
Contributor

As Cloudflare Workers directly provides the crypto API https://developers.cloudflare.com/workers/runtime-apis/web-crypto/
I added an additional check in javascript_stir to use the available crypto API.

Example usage in a Worker would be:

export default {
  async fetch(request,env,context) {    
    const _sodium = await import("libsodium-wrappers");
    await _sodium.ready;
    let binkey = _sodium.from_base64(env.PUBKEY, _sodium.base64_variants.ORIGINAL)
    return new Response('Hello');
  }
};

@jedisct1 jedisct1 merged commit 1012bbc into jedisct1:master Aug 13, 2024
7 of 8 checks passed
jedisct1 added a commit that referenced this pull request Aug 13, 2024
* Support for Cloudflare Workers for javascript_stir

* Ramove debugging comment

---------

Co-authored-by: Frank Denis <[email protected]>
ghazel pushed a commit to clostra/libsodium that referenced this pull request Sep 7, 2024
* Support for Cloudflare Workers for javascript_stir

* Ramove debugging comment

---------

Co-authored-by: Frank Denis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants