hello, i’m updating some code from string to text, and i have many problems with encodings and converting to text.
like i take this example from the doc, i just added the last 2 lines to display the result, can’t figure out why
Sub Action()
Using Xojo.Core
Using Xojo.Crypto
Dim salt,wTxt As Text = “SaltValue”
Dim saltMB As MemoryBlock
saltMB = Xojo.Core.TextEncoding.UTF8.ConvertTextToData(salt)
Dim password As Text = “YourPasswordSentence”
Dim passwordMB As MemoryBlock
passwordMB = Xojo.Core.TextEncoding.UTF8.ConvertTextToData(password)
Dim hash As MemoryBlock
hash = PBKDF2(saltMB, passwordMB, 100, 32, HashAlgorithms.SHA512)
crash here : wTxt = Xojo.Core.TextEncoding.UTF8.ConvertDataToText(hash)
The data could not be converted to text with this encoding.
i tried ascii encoding the same
TextField1.Text = wTxt
with tcp packet too i have some issues from memory block to text.
like message : Expected class MemoryBlock, but got class Xojo.Core.MemoryBlock
if i replace MemoryBlock by Xojo.Core.MemoryBlock in the current example so i a bit confused, how to convert hash to totext in this example…
thanks a lot