using Masuit.Tools.Strings;
using System;
namespace Masuit.Tools;
public static class LongExtensions
{
///
/// 十进制转任意进制
///
///
/// 进制
///
public static string ToBase(this long num, byte newBase)
{
var nf = new NumberFormater(newBase);
return nf.ToString(num);
}
///
/// 转换成字节数组
///
///
///
public static byte[] GetBytes(this long value)
{
return BitConverter.GetBytes(value);
}
///
/// 十进制转任意进制
///
///
/// 进制
///
public static string ToBase(this ulong num, byte newBase)
{
var nf = new NumberFormater(newBase);
return nf.ToString(num);
}
///
/// 转换成字节数组
///
///
///
public static byte[] GetBytes(this ulong value)
{
return BitConverter.GetBytes(value);
}
}