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