Thank you, thedesolatesoul.
It does seem as if B4A doesn't allow reading and writing to the same variable for some operations but not others (for example, x=4:x=x+2 works fine). Based on your advice, here's the revised code I used by making sure a variable was only read or written to:
Dim Bconv As ByteConverter
Dim datatohash As String
Dim bytedata(0) as Byte
Dim hasheddata(0) As Byte
Dim stringdata As String
Dim md As MessageDigest
datatohash="abcdefg"
bytedata = Bconv.StringToBytes(datatohash, "UTF8")
hasheddata = md.GetMessageDigest(bytedata, "SHA-512")
stringdata=Bconv.StringFromBytes(hasheddata,"UTF8")
Log (stringdata)
While this code doesn't produce a compiling error, it also doesn't seem to produce a hash as string. When I run this code, I get funny, non-string characters.
I was able to run similar code as my original (and as in the thread
http://www.b4x.com/forum/libraries-developers-questions/10273-hex-string.html#post57117) to get a hexadecimal hash (without errors), but it seems that the SQLite database won't accept hexadecimal. That's why I'm trying to get a string version of a hash.
How does one create a hash that SQLite will accept?