Exemple #1
0
        public static ulong GenerateLocation2(double lat, double lng, double alt, uint hashSeed)
        {
            var locationBytes = new List <byte>();

            locationBytes.AddRange(BitConverter.GetBytes(lat).Reverse());
            locationBytes.AddRange(BitConverter.GetBytes(lng).Reverse());
            locationBytes.AddRange(BitConverter.GetBytes(alt).Reverse());

            return(NiaHash.compute_hash32(locationBytes.ToArray(), hashSeed));
        }
Exemple #2
0
        public static ulong GenerateRequestHash(byte[] authTicket, byte[] request, uint hashSeed)
        {
            var first_hash = NiaHash.compute_hash64(authTicket, hashSeed);

            return(NiaHash.compute_hash64(request.ToArray(), first_hash));
        }
Exemple #3
0
 public int GetLocationHash2(byte[] locationBytes)
 {
     return((int)NiaHash.Hash32(locationBytes));
 }
Exemple #4
0
 public ulong GetRequestHash(byte[] requestBytes, byte[] serializedTicket)
 {
     return(NiaHash.Hash64Salt64(requestBytes, NiaHash.Hash64(serializedTicket)));
 }
Exemple #5
0
 public int GetLocationHash1(byte[] locationBytes, byte[] serializedTicket)
 {
     return((int)NiaHash.Hash32Salt(locationBytes, NiaHash.Hash32(serializedTicket)));
 }