Skip to content

Commit

Permalink
Fix using hex instead of base64 for the checksums
Browse files Browse the repository at this point in the history
  • Loading branch information
CrazyDev05 committed Jan 15, 2025
1 parent 8dbb37c commit e161328
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

group = "de.crazydev22"
version = "1.0.0"
version = "1.0.1"

repositories {
mavenCentral()
Expand Down
3 changes: 2 additions & 1 deletion src/main/kotlin/de/crazydev22/libbyjar/func/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import org.gradle.api.artifacts.Configuration
import org.gradle.kotlin.dsl.maven
import java.io.File
import java.security.MessageDigest
import java.util.Base64

internal fun Project.addRepository(ext: LibbyJarExtension) {
repositories.maven(ext.repository)
Expand All @@ -24,7 +25,7 @@ internal fun File.checksum(algorithm: String = "SHA-256", bufferSize: Int = 4096
}

internal fun MessageDigest.toHex(): String = digest().toHex()
internal fun ByteArray.toHex() = fold(StringBuilder()) { sb, it -> sb.append("%02x".format(it)) }.toString()
internal fun ByteArray.toHex() = Base64.getEncoder().encodeToString(this)

internal fun File.createDirectory(): File {
if (!exists()) mkdirs()
Expand Down

0 comments on commit e161328

Please sign in to comment.