B4J Question Where can I find the Encryption library?

Discussion in 'B4J Questions' started by MathiasM, May 6, 2019.

  1. MathiasM

    MathiasM Member Licensed User

  2. Erel

    Erel Administrator Staff Member Licensed User

    B4A encryption library is compatible with B4J.
     
  3. MathiasM

    MathiasM Member Licensed User

    Ok, in that case I'm doing something wrong..
    I have this code for testing:

    Code:
    Dim testString As String = "test"
       
    Dim crypto As MessageDigest
       
    Log(crypto.GetMessageDigest(testString.GetBytes("UTF8"), "SHA-512"))
    Error:

    Any idea?
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    You cannot log arrays of bytes. GetMessageDigest returns an array of bytes.

    If you want to log it:
    Code:
    Dim bc As ByteConverter
    Log(bc.HexFromBytes(crypto.GetMessageDigest(...)))
     
    DonManfred and MathiasM like this.
  5. MathiasM

    MathiasM Member Licensed User

    Thanks Erel!

    Rookie mistake on my part.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice