Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

SHA1 in IL2CPP problem

Discussion in 'iOS and tvOS' started by GilCat, Feb 23, 2015.

  1. GilCat

    GilCat

    Joined:
    Sep 21, 2013
    Posts:
    676
    Hello
    I'm having problems generating sha1 hashes when using il2cpp.

    Code (CSharp):
    1.     string myTestString = "test";
    2.     SHA1 sha1 = new SHA1CryptoServiceProvider();
    3.     byte[] src = sha1.ComputeHash(Encoding.UTF8.GetBytes(myTestString));
    4.  
    5.     string  result = Convert.ToBase64String(src);
    This is returning wrong hash in IL2CPP
    Using IL2CPP result is V4PU7q23qpin53OfQvrkp5havWc=
    Not using IL2CPP result is qUqP5cyxm6YcTAhz05Hph5gvu9M=
    Tested and confirm that convertion to Base64 works fine.

    Thanks
     
    Last edited: Feb 23, 2015
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,747
    This was a bug introduced in 4.6.3. It will be corrected in 4.6.3p1. Sorry for the inconvenience.
     
    VeTaL and GilCat like this.
  3. GilCat

    GilCat

    Joined:
    Sep 21, 2013
    Posts:
    676
    Thanks.
    I was under the impression that i had it working before too.

    Good job :)