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