B4J Question (SOLVED) Comparing Files - Sync App - getting md5

Xandoca

Active Member
Licensed User
Longtime User
Hi,

How to get md5 from a file?

I've follow code below but I think that it's B4A code because I get error on "MessageDigest". is there a library for B4J with MessageDigest?

B4X:
    Dim in As InputStream
    in = File.OpenInput(dir,filename)
    Dim buffer(File.Size(dir, filename)) As Byte
    count = in.ReadBytes(buffer, 0, buffer.length)
    Dim Bconv As ByteConverter
    Dim data(buffer.Length) As Byte
    Dim md As MessageDigest
    data = md.GetMessageDigest(buffer, "MD5")
    Log("Hash: " & Bconv.HexFromBytes(data))
Thanks.
 
Top