Skip to content

Instantly share code, notes, and snippets.

@soaresdiogo
Created January 29, 2019 19:06
Show Gist options
  • Save soaresdiogo/fa5682025f1e0f8f0834e652eca3f979 to your computer and use it in GitHub Desktop.
Save soaresdiogo/fa5682025f1e0f8f0834e652eca3f979 to your computer and use it in GitHub Desktop.
Generate Hash to MANIFEST.MF
FileStream fs = new FileStream(@"/index-v1.json", FileMode.Open);
using (BinaryReader s = new BinaryReader(fs))
{
byte[] bytes = new byte[50 * 1024];
string hashBase64 = ParseToSha1(bytes);
Debug.WriteLine("index-v1.json: " + hashBase64);
}
//Or by text
StringBuilder sb = new StringBuilder();
sb.Append("Name: index-v1.json");
sb.Append(Environment.NewLine);
sb.Append("SHA1-Digest: +nfT/Wz3YmkX+lNO5MHJ1LM01oQ=");
sb.Append(Environment.NewLine);
sb.Append(Environment.NewLine);
Debug.WriteLine("Line 7 FDROID-3.SF: " + ParseToSha1(Encoding.ASCII.GetBytes(sb.ToString())));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment