mirror of
https://github.com/nsnail/ns-ext.git
synced 2025-06-17 06:23:22 +08:00
feat: long 类型增加rand方法
This commit is contained in:
parent
f2444b3048
commit
7e204aea5d
@ -15,6 +15,15 @@ public static class LongExtensions
|
|||||||
return (me & val) == val;
|
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>
|
/// <summary>
|
||||||
/// 1970毫秒数转换成日期对象
|
/// 1970毫秒数转换成日期对象
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user