From 6e628e887425d2ce28d56e4568097bbe998ed1d8 Mon Sep 17 00:00:00 2001 From: konard Date: Sat, 13 Sep 2025 00:27:33 +0300 Subject: [PATCH 1/3] Initial commit with task details for issue #53 Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: https://github.com/linksplatform/Random/issues/53 --- CLAUDE.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..22fba02 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,5 @@ +Issue to solve: https://github.com/linksplatform/Random/issues/53 +Your prepared branch: issue-53-d8b25e8f +Your prepared working directory: /tmp/gh-issue-solver-1757712450083 + +Proceed. \ No newline at end of file From 76d29fd0dcb37c730d06c39a5dcb8676281370c3 Mon Sep 17 00:00:00 2001 From: konard Date: Sat, 13 Sep 2025 00:35:21 +0300 Subject: [PATCH 2/3] Replace custom Random instance with Random.Shared from .NET 6+ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Changed RandomHelpers.Default from custom Random instance with DateTime.UtcNow.Ticks seed to use System.Random.Shared - Updated documentation to reflect thread-safe nature of Random.Shared - Incremented version to 0.4.0 for next release - Updated package release notes - All existing tests pass with the new implementation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- csharp/Platform.Random/Platform.Random.csproj | 4 ++-- csharp/Platform.Random/RandomHelpers.cs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/csharp/Platform.Random/Platform.Random.csproj b/csharp/Platform.Random/Platform.Random.csproj index 7701c96..9fdc245 100644 --- a/csharp/Platform.Random/Platform.Random.csproj +++ b/csharp/Platform.Random/Platform.Random.csproj @@ -4,7 +4,7 @@ LinksPlatform's Platform.Random Class Library Konstantin Diachenko Platform.Random - 0.3.0 + 0.4.0 Konstantin Diachenko net8 Platform.Random @@ -23,7 +23,7 @@ true snupkg latest - Update target framework from net7 to net8. + Replace custom Random instance with Random.Shared from .NET 6+ for improved thread safety and performance. enable diff --git a/csharp/Platform.Random/RandomHelpers.cs b/csharp/Platform.Random/RandomHelpers.cs index 93655b0..7e40c18 100644 --- a/csharp/Platform.Random/RandomHelpers.cs +++ b/csharp/Platform.Random/RandomHelpers.cs @@ -7,9 +7,9 @@ namespace Platform.Random public static class RandomHelpers { /// - /// Returns the pseudorandom number generator that is using the time of the first access to this field as seed. - /// Возвращает генератор псевдослучайных чисел использующий в качестве seed время первого обращения к этому полю. + /// Returns the shared, thread-safe pseudorandom number generator from .NET 6+. + /// Возвращает разделяемый, потокобезопасный генератор псевдослучайных чисел из .NET 6+. /// - public static readonly System.Random Default = new System.Random(System.DateTime.UtcNow.Ticks.GetHashCode()); + public static System.Random Default => System.Random.Shared; } } From 97272d4d2ca25f756d08807344849183f69d6c93 Mon Sep 17 00:00:00 2001 From: konard Date: Sat, 13 Sep 2025 00:36:06 +0300 Subject: [PATCH 3/3] Remove CLAUDE.md - Claude command completed --- CLAUDE.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md deleted file mode 100644 index 22fba02..0000000 --- a/CLAUDE.md +++ /dev/null @@ -1,5 +0,0 @@ -Issue to solve: https://github.com/linksplatform/Random/issues/53 -Your prepared branch: issue-53-d8b25e8f -Your prepared working directory: /tmp/gh-issue-solver-1757712450083 - -Proceed. \ No newline at end of file