Files
JJBB/Assets/Project/Script/GameLogic/GameManager/BundleEncryption.cs
2024-08-23 15:49:34 +08:00

25 lines
531 B
C#

using UnityEngine;
using System.Collections;
using System.IO;
public class BundleEncryption
{
public static byte[] Encryption(string filePath)
{
var fileBytes = File.ReadAllBytes(filePath);
for (int i = 0; i < fileBytes.Length; ++i)
{
fileBytes[i] = (byte)~fileBytes[i];
}
return fileBytes;
}
public static void Decryption(byte[] bytes)
{
for (int i = 0; i < bytes.Length; ++i)
{
bytes[i] = (byte)~bytes[i];
}
}
}