Fix #4657: Implement UUID.randomUUID() using java.security.SecureRandom.#4659
Fix #4657: Implement UUID.randomUUID() using java.security.SecureRandom.#4659sjrd merged 2 commits intoscala-js:mainfrom
Conversation
|
Just curious if this import is needed? |
|
It doesn't seem so, but it's also not related to this PR so I won't touch it now. |
|
I can confirm that the Scala Native doesn't have an import and looks like it is code from Scala.js but it doesn't have an attribution. |
|
@sjrd are you sure that quite degradation to I afraid that it may introduce an issue like this one: https://android-developers.googleblog.com/2013/08/some-securerandom-thoughts.html |
|
Of course it's not a good idea! That's why it's only in the package called The other, recommended package does not silently degrade. It guarantees that it will throw if it can't use a proper source of cryptographically secure random numbers. |
…cureRandom. Since Scala.js core does not implement `SecureRandom`, this means that `randomUUID()` will fail to link unless `SecureRandom` is otherwise provided. We move the tests for `randomUUID()` in the test-suite-ex, and we implement a fake `SecureRandom` in the javalib-ext-dummies for testing purposes.
83bc2ce to
9def628
Compare
Since Scala.js core does not implement
SecureRandom, this means thatrandomUUID()will fail to link unlessSecureRandomis otherwise provided.We move the tests for
randomUUID()in the test-suite-ex, and we implement a fakeSecureRandomin the javalib-ext-dummies for testing purposes.Accompanying PRs in https://github.com/scala-js/scala-js-java-securerandom and https://github.com/scala-js/scala-js-fake-insecure-java-securerandom are coming.