Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small hash-related improvements #8217

Merged
merged 2 commits into from
Feb 2, 2024
Merged
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
3 changes: 2 additions & 1 deletion plugins/package-managers/pub/src/main/kotlin/Pub.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import org.ossreviewtoolkit.downloader.VcsHost
import org.ossreviewtoolkit.downloader.VersionControlSystem
import org.ossreviewtoolkit.model.EMPTY_JSON_NODE
import org.ossreviewtoolkit.model.Hash
import org.ossreviewtoolkit.model.HashAlgorithm
import org.ossreviewtoolkit.model.Identifier
import org.ossreviewtoolkit.model.Issue
import org.ossreviewtoolkit.model.Package
Expand Down Expand Up @@ -609,7 +610,7 @@ class Pub(

RemoteArtifact(
url = "$hostUrl/packages/$rawName/versions/$version.tar.gz",
hash = Hash.create(sha256)
hash = Hash.create(sha256, HashAlgorithm.SHA256.name)
)
} else {
RemoteArtifact.EMPTY
Expand Down
2 changes: 1 addition & 1 deletion utils/common/src/main/kotlin/Extensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import java.util.Locale
inline fun <T> T.alsoIfNull(block: (T) -> Unit): T = this ?: also(block)

/**
* Return a string of hexadecimal digits representing the bytes in the array.
* Return a string of lowercase hexadecimal digits representing the bytes in the array.
*/
fun ByteArray.encodeHex(): String = joinToString("") { String.format(Locale.ROOT, "%02x", it) }

Expand Down
Loading