java.lang.Object
com.craftingdead.protect.client.integrity.util.HashUtil

public final class HashUtil extends Object
Utility class for file hashing operations.
  • Method Details

    • sha256

      public static String sha256(Path path) throws IOException
      Computes SHA-256 hash of a file.
      Parameters:
      path - Path to the file to hash
      Returns:
      Hexadecimal string representation of the hash
      Throws:
      IOException - If file cannot be read
    • sha256

      public static String sha256(InputStream is) throws IOException
      Computes SHA-256 hash of an input stream. Does not close the stream.
      Parameters:
      is - InputStream to hash
      Returns:
      Hexadecimal string representation of the hash
      Throws:
      IOException - If stream cannot be read