private static string EncryptVector2Value(string key, Vector2 value) { byte[] array = new byte[8]; Buffer.BlockCopy(BitConverter.GetBytes(value.x), 0, array, 0, 4); Buffer.BlockCopy(BitConverter.GetBytes(value.y), 0, array, 4, 4); return(ObscuredPrefs.EncryptData(key, array, ObscuredPrefs.DataType.Vector2)); }
private static string EncryptVector2Value(string key, Vector2 value) { byte[] cleanBytes = new byte[8]; Buffer.BlockCopy((Array)BitConverter.GetBytes((float)value.x), 0, (Array)cleanBytes, 0, 4); Buffer.BlockCopy((Array)BitConverter.GetBytes((float)value.y), 0, (Array)cleanBytes, 4, 4); return(ObscuredPrefs.EncryptData(key, cleanBytes, ObscuredPrefs.DataType.Vector2)); }
private static string EncryptRectValue(string key, Rect value) { byte[] array = new byte[16]; Buffer.BlockCopy(BitConverter.GetBytes(value.x), 0, array, 0, 4); Buffer.BlockCopy(BitConverter.GetBytes(value.y), 0, array, 4, 4); Buffer.BlockCopy(BitConverter.GetBytes(value.width), 0, array, 8, 4); Buffer.BlockCopy(BitConverter.GetBytes(value.height), 0, array, 12, 4); return(ObscuredPrefs.EncryptData(key, array, ObscuredPrefs.DataType.Rect)); }
private static string EncryptQuaternionValue(string key, Quaternion value) { byte[] array = new byte[16]; Buffer.BlockCopy(BitConverter.GetBytes(value.x), 0, array, 0, 4); Buffer.BlockCopy(BitConverter.GetBytes(value.y), 0, array, 4, 4); Buffer.BlockCopy(BitConverter.GetBytes(value.z), 0, array, 8, 4); Buffer.BlockCopy(BitConverter.GetBytes(value.w), 0, array, 12, 4); return(ObscuredPrefs.EncryptData(key, array, ObscuredPrefs.DataType.Quaternion)); }
private static string EncryptQuaternionValue(string key, Quaternion value) { byte[] cleanBytes = new byte[16]; Buffer.BlockCopy((Array)BitConverter.GetBytes((float)value.x), 0, (Array)cleanBytes, 0, 4); Buffer.BlockCopy((Array)BitConverter.GetBytes((float)value.y), 0, (Array)cleanBytes, 4, 4); Buffer.BlockCopy((Array)BitConverter.GetBytes((float)value.z), 0, (Array)cleanBytes, 8, 4); Buffer.BlockCopy((Array)BitConverter.GetBytes((float)value.w), 0, (Array)cleanBytes, 12, 4); return(ObscuredPrefs.EncryptData(key, cleanBytes, ObscuredPrefs.DataType.Quaternion)); }
private static string EncryptRectValue(string key, Rect value) { byte[] cleanBytes = new byte[16]; // ISSUE: explicit reference operation Buffer.BlockCopy((Array)BitConverter.GetBytes(((Rect)@value).get_x()), 0, (Array)cleanBytes, 0, 4); // ISSUE: explicit reference operation Buffer.BlockCopy((Array)BitConverter.GetBytes(((Rect)@value).get_y()), 0, (Array)cleanBytes, 4, 4); // ISSUE: explicit reference operation Buffer.BlockCopy((Array)BitConverter.GetBytes(((Rect)@value).get_width()), 0, (Array)cleanBytes, 8, 4); // ISSUE: explicit reference operation Buffer.BlockCopy((Array)BitConverter.GetBytes(((Rect)@value).get_height()), 0, (Array)cleanBytes, 12, 4); return(ObscuredPrefs.EncryptData(key, cleanBytes, ObscuredPrefs.DataType.Rect)); }
private static string EncryptColorValue(string key, uint value) { byte[] bytes = BitConverter.GetBytes(value); return(ObscuredPrefs.EncryptData(key, bytes, ObscuredPrefs.DataType.Color)); }
private static string EncryptByteArrayValue(string key, byte[] value) { return(ObscuredPrefs.EncryptData(key, value, ObscuredPrefs.DataType.ByteArray)); }
private static string EncryptBoolValue(string key, bool value) { byte[] bytes = BitConverter.GetBytes(value); return(ObscuredPrefs.EncryptData(key, bytes, ObscuredPrefs.DataType.Bool)); }
private static string EncryptLongValue(string key, long value) { byte[] bytes = BitConverter.GetBytes(value); return(ObscuredPrefs.EncryptData(key, bytes, ObscuredPrefs.DataType.Long)); }
private static string EncryptDoubleValue(string key, double value) { byte[] bytes = BitConverter.GetBytes(value); return(ObscuredPrefs.EncryptData(key, bytes, ObscuredPrefs.DataType.Double)); }
internal static string EncryptFloatValue(string key, float value) { byte[] bytes = BitConverter.GetBytes(value); return(ObscuredPrefs.EncryptData(key, bytes, ObscuredPrefs.DataType.Float)); }
internal static string EncryptStringValue(string key, string value) { byte[] bytes = Encoding.UTF8.GetBytes(value); return(ObscuredPrefs.EncryptData(key, bytes, ObscuredPrefs.DataType.String)); }