How to Fix a "ChecksumMismatch Error:SHA256" in a Mac?

I am trying to install OpenCV in my Mac using HomeBrew. One of the dependencies "gnutl" is having a ChecksumMismatch error in installing. Using a Mac 10.11.6; Help me Out.

I have previously installed OpenCV4 and it wasnt a problem back then. I wanted the OpenCV3 and so I Uninstalled the OpenCV4 and Now i am unable to install any of the OpenCV Due to the issue of "gnutl".

I Have also come across the Issue#43156 on Github which is a Same case but it doesn't solve mine (https://github.com/Homebrew/homebrew-core/issues/43156).

I have Deleted the Patch File, did Brew Clean, and tried re-installing it which results in the same error. I have re-installed HomeBrew and still the same error.

Am a beginner; Please Guide me through whats wrong.

==> Downloading https://www.gnupg.org/ftp/gcrypt/gnutls/v3.6/gnutls-3.6.9.tar.xz
Already downloaded: /Users/apple/Library/Caches/Homebrew/downloads/10375e457c78424d079bc03dc50b19e2d8f153be4087edde62a035a2627d8c6f--gnutls-3.6.9.tar.xz
==> Downloading https://gitlab.com/gnutls/gnutls/commit/ef80617d1e17e0878a909baa
Already downloaded: /Users/apple/Library/Caches/Homebrew/downloads/0c113ab0098bc4c3f2e8f410741b6104f2928fe63eb38cf98f8dcc3362f02ac4--ef80617d1e17e0878a909baad62a75ba265c0e00.patch
Error: An exception occurred within a child process:
  ChecksumMismatchError: SHA256 mismatch
Expected: 3b1634fa348c0f0064e43f3fb673e30a5e46f2b51cd6cd0d4a0cbf326e71c90e
  Actual: c150aa81c8fbbce15af3843ad0b8c048170faac6c933ef1a44bd40dc0cd1e2f0
 Archive: /Users/apple/Library/Caches/Homebrew/downloads/0c113ab0098bc4c3f2e8f410741b6104f2928fe63eb38cf98f8dcc3362f02ac4--ef80617d1e17e0878a909baad62a75ba265c0e00.patch
To retry an incomplete download, remove the file above.

I am also Attaching the Patch File if its gonna help.

From ef80617d1e17e0878a909baad62a75ba265c0e00 Mon Sep 17 00:00:00 2001
From: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date: Fri, 2 Aug 2019 21:57:40 +0200
Subject: [PATCH] read_cpuid_vals: use __get_cpuid_count() only when available

This makes the functionality available on gcc 4.8.

Resolves: #812

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
---
 configure.ac                     | 11 +++++++++++
 lib/accelerated/x86/x86-common.c | 24 ++++++++++++++++++++----
 2 files changed, 31 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index 6a1d3dbc5c..1bf9bce95e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -182,6 +182,17 @@ case $host_cpu in
   ;;
 esac

+# check for gcc's __get_cpuid_count functionality
+AC_MSG_CHECKING([for __get_cpuid_count])
+AC_LINK_IFELSE(
+   [AC_LANG_SOURCE([
+    #include <cpuid.h>
+    int main(void) { unsigned t1; return __get_cpuid_count(7, 0, &t1, &t1, &t1, &t1); }
+   ])],
+   [AC_DEFINE([HAVE_GET_CPUID_COUNT], [1], [use __get_cpuid_count]) AC_MSG_RESULT([yes])],
+   [AC_MSG_RESULT([no])]
+)
+
 fi

 AC_ARG_ENABLE(tls13-interop,
diff --git a/lib/accelerated/x86/x86-common.c b/lib/accelerated/x86/x86-common.c
index fb3ff90919..516d6776c5 100644
--- a/lib/accelerated/x86/x86-common.c
+++ b/lib/accelerated/x86/x86-common.c
@@ -106,17 +106,33 @@ unsigned int _gnutls_x86_cpuid_s[4];
 #define VIA_PADLOCK_PHE (1<<21)
 #define VIA_PADLOCK_PHE_SHA512 (1<<22)

+#ifndef HAVE_GET_CPUID_COUNT
+static inline void
+get_cpuid_level7(unsigned int *eax, unsigned int *ebx,
+        unsigned int *ecx, unsigned int *edx)
+{
+   /* we avoid using __get_cpuid_count, because it is not available with gcc 4.8 */
+   if (__get_cpuid_max(7, 0) < 7)
+       return;
+
+   __cpuid_count(7, 0, *eax, *ebx, *ecx, *edx);
+   return;
+}
+#else
+# define get_cpuid_level7(a,b,c,d) __get_cpuid_count(7, 0, a, b, c, d)
+#endif
+
 static unsigned read_cpuid_vals(unsigned int vals[4])
 {
    unsigned t1, t2, t3;
-   if (!__get_cpuid(1, &t1, &vals[0],
-            &vals[1], &t2))
+   vals[0] = vals[1] = vals[2] = vals[3] = 0;
+
+   if (!__get_cpuid(1, &t1, &vals[0], &vals[1], &t2))
        return 0;
    /* suppress AVX512; it works conditionally on certain CPUs on the original code */
    vals[1] &= 0xfffff7ff;

-   if (!__get_cpuid_count(7, 0, &t1, &vals[2], &t2, &t3))
-       return 0;
+   get_cpuid_level7(&t1, &vals[2], &t2, &t3);

    return 1;
 }
--
2.22.0