fix: rewrite remote update

This commit is contained in:
2025-05-04 16:38:40 +08:00
parent e6d177cf15
commit c6b819f24f
3 changed files with 310 additions and 245 deletions

View File

@@ -12,9 +12,9 @@ namespace Common
/// </summary>
/// <param name="num">整数</param>
/// <param name="length">整数长度</param>
/// <param name="isRightHigh">是否高位在右边</param>
/// <param name="isLowNumHigh">是否高位在数组索引低</param>
/// <returns>二进制字节数组</returns>
public static Result<byte[]> NumberToBytes(ulong num, uint length, bool isRightHigh = false)
public static Result<byte[]> NumberToBytes(ulong num, uint length, bool isLowNumHigh = false)
{
if (length > 8)
{
@@ -26,7 +26,7 @@ namespace Common
var arr = new byte[length];
if (isRightHigh)
if (isLowNumHigh)
{
for (var i = 0; i < length; i++)
{
@@ -47,9 +47,9 @@ namespace Common
/// 二进制字节数组转成64bits整数
/// </summary>
/// <param name="bytes">二进制字节数组</param>
/// <param name="isRightHigh">是否高位在右边</param>
/// <param name="isLowNumHigh">是否高位在数组索引低</param>
/// <returns>整数</returns>
public static Result<UInt64> BytesToUInt64(byte[] bytes, bool isRightHigh = false)
public static Result<UInt64> BytesToUInt64(byte[] bytes, bool isLowNumHigh = false)
{
if (bytes.Length > 8)
{
@@ -64,7 +64,7 @@ namespace Common
try
{
if (isRightHigh)
if (isLowNumHigh)
{
for (var i = 0; i < len; i++)
{
@@ -91,9 +91,9 @@ namespace Common
/// 二进制字节数组转成32bits整数
/// </summary>
/// <param name="bytes">二进制字节数组</param>
/// <param name="isRightHigh">是否高位在右边</param>
/// <param name="isLowNumHigh">是否高位在数组索引低</param>
/// <returns>整数</returns>
public static Result<UInt32> BytesToUInt32(byte[] bytes, bool isRightHigh = false)
public static Result<UInt32> BytesToUInt32(byte[] bytes, bool isLowNumHigh = false)
{
if (bytes.Length > 4)
{
@@ -108,7 +108,7 @@ namespace Common
try
{
if (isRightHigh)
if (isLowNumHigh)
{
for (var i = 0; i < len; i++)
{