Skip to content

Commit

Permalink
refactor: only include random class for targets that require it
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Brault <[email protected]>
  • Loading branch information
xaevik committed May 27, 2024
1 parent 8a65d38 commit f0651b9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cuid.net/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ internal static class Utils

private const int Radix = 36;

#if NETSTANDARD2_0 || NET472
private static readonly Random Random = new();
#endif

[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static long Decode(ReadOnlySpan<char> input)
Expand Down Expand Up @@ -70,7 +72,7 @@ internal static string Encode(ulong value)
do
{
ulong c = value % Radix;
buffer[--i] = (char) ( c is >= 0 and <= 9 ? c + 48 : c + 'a' - 10 );
buffer[--i] = (char) ( c <= 9 ? c + 48 : c + 'a' - 10 );

value /= Radix;
} while ( value > 0 );
Expand Down

0 comments on commit f0651b9

Please sign in to comment.