How to Calculate the Hash of a PDF File
Posted: Fri Mar 26, 2021 4:19 am
Hello!
How to Calculate the Hash of a PDF File
Does anyone know how to calculate the hash of a pdf or jpg file using Xbase ++?
Something like that:
' VB.NET
Dim Imagem = "imagem.jpg"
Dim HashImagem = CalcularHash(Imagem)
Dim HashImagemString = BitConverter.ToString(HashImagem).Replace("-", "").ToLower()
Console.WriteLine(HashImagemString)
' VB.NET
Private Function CalcularHash(Arquivo As String) As Byte()
Using Md5 = System.Security.Cryptography.MD5.Create()
Using Stream = System.IO.File.OpenRead(Arquivo)
Return Md5.ComputeHash(Stream)
End Using
End Using
End Function
How to Calculate the Hash of a PDF File
Does anyone know how to calculate the hash of a pdf or jpg file using Xbase ++?
Something like that:
' VB.NET
Dim Imagem = "imagem.jpg"
Dim HashImagem = CalcularHash(Imagem)
Dim HashImagemString = BitConverter.ToString(HashImagem).Replace("-", "").ToLower()
Console.WriteLine(HashImagemString)
' VB.NET
Private Function CalcularHash(Arquivo As String) As Byte()
Using Md5 = System.Security.Cryptography.MD5.Create()
Using Stream = System.IO.File.OpenRead(Arquivo)
Return Md5.ComputeHash(Stream)
End Using
End Using
End Function