Add support for project ATs

This commit is contained in:
Juuxel
2020-12-03 17:48:28 +02:00
parent 2a10b70546
commit 2d88e849ec
5 changed files with 103 additions and 25 deletions

View File

@@ -26,6 +26,7 @@ package net.fabricmc.loom.util;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import com.google.common.hash.HashCode;
import com.google.common.hash.Hashing;
@@ -67,4 +68,9 @@ public class Checksum {
throw new RuntimeException("Failed to get file hash");
}
}
public static byte[] sha256(String string) {
HashCode hash = Hashing.sha256().hashString(string, StandardCharsets.UTF_8);
return hash.asBytes();
}
}