using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.Security.Cryptography;
using System;
using System.IO;
using System.Text;
public class Md5Test : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if(Input.GetKeyDown(KeyCode.Escape))
{
}
}
[MenuItem("Custom Editor/MD5")]
private static void GetMD5()
{
var path = EditorUtility.OpenFilePanel("", "", "lua");
FileStream file = new FileStream(path, System.IO.FileMode.Open);
MD5 md5 = new MD5CryptoServiceProvider();
byte[] retVal = md5.ComputeHash(file);
file.Close();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < retVal.Length; i++)
{
sb.Append(retVal[i].ToString("x2"));
}
Debug.Log(sb.ToString());
}
}
Unity 计算文件MD5
猜你喜欢
转载自blog.csdn.net/qq_41179365/article/details/119389271
今日推荐
周排行