mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-10 03:45:41 +00:00
parent
1c0768c472
commit
c014b7d410
@ -1,3 +1 @@
|
||||
using System;
|
||||
|
||||
[assembly: CLSCompliant(true)]
|
||||
[assembly: CLSCompliant(true)]
|
||||
|
@ -1,5 +1,3 @@
|
||||
using System;
|
||||
|
||||
namespace X10D
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -1,6 +1,4 @@
|
||||
using System;
|
||||
|
||||
namespace X10D
|
||||
namespace X10D
|
||||
{
|
||||
/// <summary>
|
||||
/// Extension methods for <see cref="DateTime" />.
|
||||
|
@ -1,6 +1,4 @@
|
||||
using System;
|
||||
|
||||
namespace X10D
|
||||
namespace X10D
|
||||
{
|
||||
/// <summary>
|
||||
/// Extension methods for <see cref="DateTimeOffset" />.
|
||||
|
@ -67,7 +67,7 @@ namespace X10D
|
||||
throw new ArgumentNullException(nameof(random));
|
||||
}
|
||||
|
||||
var seed = random.Next();
|
||||
int seed = random.Next();
|
||||
var seededRandom = new Random(seed);
|
||||
|
||||
var r = (byte)(seededRandom.Next() % (byte.MaxValue + 1));
|
||||
@ -196,9 +196,9 @@ namespace X10D
|
||||
throw new ArgumentNullException(nameof(random));
|
||||
}
|
||||
|
||||
var sample = random.Next();
|
||||
int sample = random.Next();
|
||||
var sampledRandom = new Random(sample);
|
||||
return (long)sample << 32 | sampledRandom.Next();
|
||||
return ((long)sample << 32) | (uint)sampledRandom.Next();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -317,12 +317,12 @@ namespace X10D
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
var array = source.ToCharArray();
|
||||
char[] array = source.ToCharArray();
|
||||
var builder = new StringBuilder(length);
|
||||
|
||||
while (builder.Length < length)
|
||||
{
|
||||
var next = random.NextFrom(array);
|
||||
char next = random.NextFrom(array);
|
||||
builder.Append(next);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user