feat: long 类型增加rand方法

This commit is contained in:
tk 2023-04-19 14:59:11 +08:00
parent f2444b3048
commit 7e204aea5d

View File

@ -15,6 +15,15 @@ public static class LongExtensions
return (me & val) == val;
}
/// <summary>
/// 生成随机数
/// </summary>
/// <param name="me">me</param>
public static long Rand(this long[] me)
{
return new Random(Guid.NewGuid().GetHashCode()).NextInt64(me[0], me[1]);
}
/// <summary>
/// 1970毫秒数转换成日期对象
/// </summary>