Code Monkey home page Code Monkey logo

scala-js-fake-insecure-java-securerandom's Introduction

scalajs-fake-insecure-java-securerandom

scalajs-fake-insecure-java-securerandom provides compatibility stubs for java.security.SecureRandom in Scala.js.

⚠️ This library is insecure by design! ⚠️

This library is insecure by design. It does not provide a cryptographically secure implementation of SecureRandom. It is only there to preserve support for java.util.UUID.randomUUID() from Scala.js core previous to v1.10.0 in environments where secure UUID generation is not a requirement, and if there is no other choice.

Use scalajs-java-securerandom instead.

Usage from a library

Never, ever depend on scalajs-fake-insecure-securerandom from library code!

If you do, you will expose your users to insecure code.

Always use scalajs-java-securerandom instead.

Usage from an application

Almost never depend on scalajs-fake-insecure-securerandom. Use scalajs-java-securerandom instead if possible, notably if you only target browsers and/or Node.js.

If you have no other choice, use the following dependency:

libraryDependencies += ("org.scala-js" %%% "scalajs-fake-insecure-java-securerandom" % "1.0.0").cross(CrossVersion.for3Use2_13)

When using a crossProject, add the above in .jsSettings(...).

You can then use java.security.SecureRandom from your code, and by extension, the java.util.UUID.randomUUID() method. Keep in mind that the generated random numbers (and random UUIDs) will not be cryptographically secure.

License

scalajs-fake-insecure-securerandom is distributed under the Apache 2.0 license, like Scala.js itself.

scala-js-fake-insecure-java-securerandom's People

Contributors

sjrd avatar

Watchers

 avatar

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.