Class UrlDigest

java.lang.Object
io.github.intisy.gradle.github.utils.UrlDigest

public final class UrlDigest extends Object
SHA-256 hashing shared by every cache that is keyed by a hash of a URL rather than the URL itself, so a credential embedded in the URL never has to be written to a cache path.
  • Method Details

    • sha256Hex

      public static String sha256Hex(String value)
      Parameters:
      value - the string to hash, encoded as UTF-8.
      Returns:
      the hex-encoded SHA-256 of value.
    • sha256Hex

      public static String sha256Hex(File file) throws IOException
      Parameters:
      file - the file whose content to hash.
      Returns:
      the hex-encoded SHA-256 of file's content.
      Throws:
      IOException - if file cannot be read.