Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fake and *insecure* implementation of java.security.SecureRandom for Scala.js

License

NotificationsYou must be signed in to change notification settings

scala-js/scala-js-fake-insecure-java-securerandom

Repository files navigation

scalajs-fake-insecure-java-securerandom provides compatibility stubs forjava.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 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.

Usage from a library

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.

Usage from an application

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.

License

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

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp