File tree Expand file tree Collapse file tree 4 files changed +15
-11
lines changed
js/src/main/scala/scoverage
jvm/src/main/scala/scoverage
shared/src/main/scala/scoverage Expand file tree Collapse file tree 4 files changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -119,16 +119,6 @@ lazy val runtime = CrossProject(
119119 .jvmSettings(
120120 Test / fork := true
121121 )
122- .jsSettings(
123- scalaJSStage := FastOptStage ,
124- // While not exactlu ideal, this is only used in the invoker to assign a
125- // unique id to ensure measurements have unique ids. It's never exposed to
126- // the user and doesn't touch anything sensitve, so we should have no
127- // issues here. Still, I don't like having this, so we should try to
128- // replace it.
129- libraryDependencies += (" org.scala-js" %%% " scalajs-fake-insecure-java-securerandom" % " 1.0.0" )
130- .cross(CrossVersion .for3Use2_13)
131- )
132122
133123lazy val `runtimeJVM` = runtime.jvm
134124lazy val `runtimeJS` = runtime.js
Original file line number Diff line number Diff line change @@ -17,4 +17,15 @@ object Platform {
1717
1818 lazy val Source = SupportSource
1919
20+ def insecureRandomUUID () = {
21+ import scala .util .Random
22+ var msb = Random .nextLong()
23+ var lsb = Random .nextLong()
24+ msb &= 0xffffffffffff0fffL // clear version
25+ msb |= 0x0000000000004000L // set to version 4
26+ lsb &= 0x3fffffffffffffffL // clear variant
27+ lsb |= 0x8000000000000000L // set to IETF variant
28+ new java.util.UUID (msb, lsb)
29+ }
30+
2031}
Original file line number Diff line number Diff line change @@ -16,4 +16,7 @@ object Platform {
1616 type FileFilter = SupportFileFilter
1717
1818 lazy val Source = SupportSource
19+
20+ def insecureRandomUUID () = java.util.UUID .randomUUID()
21+
1922}
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import scoverage.Platform._
88/** @author Stephen Samuel */
99object Invoker {
1010
11- private val runtimeUUID = java.util. UUID .randomUUID ()
11+ private val runtimeUUID = Platform .insecureRandomUUID ()
1212
1313 private val MeasurementsPrefix = " scoverage.measurements."
1414 private val threadFiles = new ThreadLocal [mutable.HashMap [String , FileWriter ]]
You can’t perform that action at this time.
0 commit comments