Giter Club home page Giter Club logo

sodium-universal's People

Contributors

emilbayes avatar mafintosh avatar sethvincent avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

sodium-universal's Issues

Incompatibility warnings

Using sodium-universal is for people that don't want to concern themselves with platform incompatibilities (one system to work with all). As such I think it would be good for developers to have a means of using sodium-universal that also highlights if they are using something that doesn't work for some platforms. Something like:

const sodium = require('sodium-universal')
sodium.crypto_stream_xchacha20(/*...*/)

will run following in console:

[WARNING] crypto_stream_xchacha20 is not supported in browser versions.
  → you can disable this message by using: require('sodium-universal/unsafe')({ crypto_stream_xchacha20: true })
  → issue 1a: https://github.com/sodium-friends/sodium-javascript/issues/#1a

This way a person could easily see what the progress is and that the application they are building is currently not as compatible as they may think it is.

In a future step I could imagine that in a future release that supports crypto_stream_xchacha20 it could warn the other way around:

[INFO] crypto_stream_xchacha20 is now supported on all platforms since version x.9.9
  → you can disable this message by removing the `crypto_stream_xchacha20` property
    when in your require statement: require('sodium-universal/unsafe')({ ... })

I think it would be reasonable to add this to the library (including all the issues on github). Would you be okay with PR's that add this?

3.0.3 not working with browserify

Hello, I am running into this issue while trying to bundle hypercore for a web app. I have put together a minimal example project that fails to bundle with browserify. I have been trying to fix this myself but am not well experienced with browserify. Any help would be greatly appreciated, thank you.

https://github.com/rhodey/sodium-debug

> Error: Can't walk dependency graph: Cannot find module './crypto_auth' from '/home/rhodey/dev/dsp/js/sodium-debug/node_modules/sodium-universal/index.js'
    required by /home/rhodey/dev/dsp/js/sodium-debug/node_modules/sodium-universal/index.js
        at /home/rhodey/.nvm/versions/node/v14.13.1/lib/node_modules/browserify/node_modules/resolve/lib/async.js:137:35
	    at load (/home/rhodey/.nvm/versions/node/v14.13.1/lib/node_modules/browserify/node_modules/resolve/lib/async.js:156:43)
	        at onex (/home/rhodey/.nvm/versions/node/v14.13.1/lib/node_modules/browserify/node_modules/resolve/lib/async.js:181:17)
		    at /home/rhodey/.nvm/versions/node/v14.13.1/lib/node_modules/browserify/node_modules/resolve/lib/async.js:15:69
		        at FSReqCallback.oncomplete (fs.js:181:21)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.