Move HashFunction out of FileSystem, and turn it into a class, instead of an enum.

Now that we aren't using enum names for the hash functions, we also accept the standard names, such as SHA-256.

RELNOTES: None.
PiperOrigin-RevId: 201624286
diff --git a/src/main/java/com/google/devtools/build/lib/unix/UnixFileSystem.java b/src/main/java/com/google/devtools/build/lib/unix/UnixFileSystem.java
index d5a74eb..16d44a1 100644
--- a/src/main/java/com/google/devtools/build/lib/unix/UnixFileSystem.java
+++ b/src/main/java/com/google/devtools/build/lib/unix/UnixFileSystem.java
@@ -22,6 +22,7 @@
 import com.google.devtools.build.lib.unix.NativePosixFiles.Dirents;
 import com.google.devtools.build.lib.unix.NativePosixFiles.ReadTypes;
 import com.google.devtools.build.lib.vfs.AbstractFileSystemWithCustomStat;
+import com.google.devtools.build.lib.vfs.DigestHashFunction;
 import com.google.devtools.build.lib.vfs.Dirent;
 import com.google.devtools.build.lib.vfs.FileStatus;
 import com.google.devtools.build.lib.vfs.Path;
@@ -40,7 +41,7 @@
   public UnixFileSystem() {
   }
 
-  public UnixFileSystem(HashFunction hashFunction) {
+  public UnixFileSystem(DigestHashFunction hashFunction) {
     super(hashFunction);
   }
 
@@ -398,11 +399,11 @@
   }
 
   @Override
-  protected byte[] getDigest(Path path, HashFunction hashFunction) throws IOException {
+  protected byte[] getDigest(Path path, DigestHashFunction hashFunction) throws IOException {
     String name = path.toString();
     long startTime = Profiler.nanoTimeMaybe();
     try {
-      if (hashFunction == HashFunction.MD5) {
+      if (hashFunction == DigestHashFunction.MD5) {
         return NativePosixFiles.md5sum(name).asBytes();
       }
       return super.getDigest(path, hashFunction);