diff --git a/HashifyNet/Core/DataType/Base58/Base58Helper.cs b/HashifyNet/Core/DataType/Base58/Base58Helper.cs index c77b0d7..f84b65d 100644 --- a/HashifyNet/Core/DataType/Base58/Base58Helper.cs +++ b/HashifyNet/Core/DataType/Base58/Base58Helper.cs @@ -1,4 +1,4 @@ -// * +// * // ***************************************************************************** // * // * Copyright (c) 2025 Deskasoft International @@ -27,9 +27,6 @@ // ****************************************************************************** // * -using HashifyNet.Algorithms.Blake2; -using HashifyNet.Algorithms.SHA256; -using HashifyNet.Core.Utilities; using System; using System.Linq; using System.Numerics; @@ -48,11 +45,11 @@ public static string AsBase58String(byte[] data, Base58Variant variant) byte[] lilEndianData = data.Reverse().ToArray(); byte[] dataForBigInt = lilEndianData; - if (dataForBigInt.Length > 0 && (dataForBigInt[0] & 0x80) != 0) + if (dataForBigInt.Length > 0 && (dataForBigInt[dataForBigInt.Length - 1] & 0x80) != 0) { dataForBigInt = new byte[lilEndianData.Length + 1]; - Array.Copy(lilEndianData, 0, dataForBigInt, 1, lilEndianData.Length); - dataForBigInt[0] = 0; + Array.Copy(lilEndianData, 0, dataForBigInt, 0, lilEndianData.Length); + dataForBigInt[dataForBigInt.Length - 1] = 0; } var intData = new BigInteger(dataForBigInt); diff --git a/HashifyNet/HashifyNet.csproj b/HashifyNet/HashifyNet.csproj index fbaa1f1..e922ae9 100644 --- a/HashifyNet/HashifyNet.csproj +++ b/HashifyNet/HashifyNet.csproj @@ -102,7 +102,7 @@ Deskasoft International HashifyNET Copyright © Deskasoft International - 7.0.0 + 7.0.1 hashing;hash;algorithms;security;crypto;non-crypto;CLS-compliant;VB.NET;F# True False @@ -121,3 +121,4 @@ +