Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,6 @@ fun Iterable<String>.distinctStringsDigest(): ByteArray =
MessageDigest.getInstance(CLASSPATH_ID_DIGEST)
.digest(this.distinct().sorted().joinToString("").toByteArray())

fun ByteArray.toHexString(): String = joinToString("", transform = { "%02x".format(it) })


data class CompilerId(
var compilerClasspath: List<String> = listOf(),
var compilerVersion: String = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,6 @@ private fun File.readCompiledScript(): CompiledScript {
}
}

private fun ByteArray.toHexString(): String = joinToString("", transform = { "%02x".format(it) })

private fun Class<*>.supertypes(): MutableList<Class<*>> = when {
superclass == null -> interfaces.toMutableList()
interfaces.isEmpty() -> mutableListOf(superclass)
Expand Down
2 changes: 1 addition & 1 deletion libraries/stdlib/samples/test/samples/text/hexFormat.kt
Original file line number Diff line number Diff line change
Expand Up @@ -625,4 +625,4 @@ class HexFormats {
assertFailsWith<IllegalArgumentException> { "3A".hexToLong(format) }
}
}
}
}
Copy link
Contributor Author

@y9san9 y9san9 Sep 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for that.
I have this setting to add newlines to the end of files enabled. Can remove that change if that's something critical.

Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,4 @@ class ModuleChangesCatchingTest {
return MessageDigest.getInstance(HASH_ALG).digest(this)
}

private fun ByteArray.convertToHexString(): String {
return this.joinToString("") { "%02x".format(it) }
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,5 @@ private fun compiledScriptUniqueName(script: SourceCode, scriptCompilationConfig
return digestWrapper.digest().toHexString()
}

private fun ByteArray.toHexString(): String = joinToString("", transform = { "%02x".format(it) })

private fun Int.toByteArray() = ByteBuffer.allocate(Int.SIZE_BYTES).also { it.putInt(this) }.array()