- Notifications
You must be signed in to change notification settings - Fork2
Fake and *insecure* implementation of java.security.SecureRandom for Scala.js
License
scala-js/scala-js-fake-insecure-java-securerandom
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
scalajs-fake-insecure-java-securerandom
provides compatibility stubs forjava.security.SecureRandom
in Scala.js.
This library is insecure by design.It does not provide a cryptographically secure implementation ofSecureRandom
.It is only there to preserve support forjava.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.
Usescalajs-java-securerandom
instead.
Never, ever depend onscalajs-fake-insecure-securerandom
from library code!
If you do, you will expose your users to insecure code.
Always usescalajs-java-securerandom
instead.
Almost never depend onscalajs-fake-insecure-securerandom
.Usescalajs-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 acrossProject
, add the above in.jsSettings(...)
.
You can then usejava.security.SecureRandom
from your code, and by extension, thejava.util.UUID.randomUUID()
method.Keep in mind that the generated random numbers (and random UUIDs) willnot be cryptographically secure.
scalajs-fake-insecure-securerandom
is distributed under theApache 2.0 license, like Scala.js itself.
About
Fake and *insecure* implementation of java.security.SecureRandom for Scala.js
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.