We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef4f5ef commit 17d370aCopy full SHA for 17d370a
1 file changed
System/Base62.cs
@@ -24,7 +24,6 @@
24
#endregion
25
26
#nullable enable
27
-using System.Linq;
28
using System.Numerics;
29
using System.Text;
30
@@ -53,7 +52,11 @@ public static string Encode(BigInteger value)
53
52
value /= 62;
54
}
55
56
- return new string(sb.ToString().Reverse().ToArray());
+ // Reverse the string, since we're building it backwards,
+ var chars = sb.ToString().ToCharArray();
57
+ Array.Reverse(chars);
58
+
59
+ return new string(chars);
60
61
62
/// <summary>
@@ -78,4 +81,4 @@ public static BigInteger Decode(string value)
78
81
_ => throw new ArgumentException($"Cannot decode char '{c}' from base 62.", nameof(c)),
79
82
};
80
83
-}
84
+}
0 commit comments