mirror of
https://github.com/packwiz/packwiz-installer.git
synced 2025-05-08 13:36:30 +02:00
Add SHA1 support (see https://github.com/comp500/packwiz/pull/11)
This commit is contained in:
parent
2c02703101
commit
226e754547
@ -4,7 +4,8 @@ object HashUtils {
|
|||||||
private val hashTypeConversion: Map<String, IHasher> = mapOf(
|
private val hashTypeConversion: Map<String, IHasher> = mapOf(
|
||||||
"sha256" to HashingSourceHasher("sha256"),
|
"sha256" to HashingSourceHasher("sha256"),
|
||||||
"sha512" to HashingSourceHasher("sha512"),
|
"sha512" to HashingSourceHasher("sha512"),
|
||||||
"murmur2" to Murmur2Hasher()
|
"murmur2" to Murmur2Hasher(),
|
||||||
|
"sha1" to HashingSourceHasher("sha1")
|
||||||
)
|
)
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
|
@ -35,6 +35,7 @@ class HashingSourceHasher internal constructor(private val type: String) : IHash
|
|||||||
"md5" -> return HashingSourceGeneralHashingSource(HashingSource.md5(delegate))
|
"md5" -> return HashingSourceGeneralHashingSource(HashingSource.md5(delegate))
|
||||||
"sha256" -> return HashingSourceGeneralHashingSource(HashingSource.sha256(delegate))
|
"sha256" -> return HashingSourceGeneralHashingSource(HashingSource.sha256(delegate))
|
||||||
"sha512" -> return HashingSourceGeneralHashingSource(HashingSource.sha512(delegate))
|
"sha512" -> return HashingSourceGeneralHashingSource(HashingSource.sha512(delegate))
|
||||||
|
"sha1" -> return HashingSourceGeneralHashingSource(HashingSource.sha1(delegate))
|
||||||
}
|
}
|
||||||
throw RuntimeException("Invalid hash type provided")
|
throw RuntimeException("Invalid hash type provided")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user