Files
2026-09-09 19:21:21 +08:00

23 lines
627 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JinYuan.Helper
{
public static class ConvertHelper
{
/// <summary>
/// 字节数组高低位转换
/// </summary>
/// <param name="Arrbyte"></param>
/// <returns></returns>
public static byte[] ByteReverse(this byte[] Arrbyte)
{
byte[] ArrByte = Arrbyte.Select((x, i) => new { x, i }).GroupBy(x => x.i / 2).SelectMany(x => new byte[] { x.Last().x, x.First().x }).ToArray();
return ArrByte;
}
}
}