/// <inheritdoc />
        protected override string OnGenerateInHex(
            FileInfo file,
            CancellationToken cancellationToken)
        {
            if (UsingBouncyCastleFirst)
            {
                return(DoGenerateInHex(
                           file,
                           cancellationToken
                           ));
            }

            try
            {
                return(DefaultSha256.DoGenerateInHex(
                           file,
                           cancellationToken
                           ));
            }
            catch (Exception e)
            {
                if (e is OperationCanceledException)
                {
                    throw;
                }

                Logger.GetInstance(typeof(Sha256Impl)).Fatal($"Generating checksum by system error: {e}");
                UsingBouncyCastleFirst = true;
            }
            return(DoGenerateInHex(
                       file,
                       cancellationToken
                       ));
        }
        /// <inheritdoc />
        protected override async Task <string> OnGenerateInBase64Async(
            FileInfo file,
            CancellationToken cancellationToken)
        {
            if (UsingBouncyCastleFirst)
            {
                return(await DoGenerateInBase64Async(
                           file,
                           cancellationToken
                           ).ConfigureAwait(false));
            }

            try
            {
                return(await DefaultSha256.DoGenerateInBase64Async(
                           file,
                           cancellationToken
                           ).ConfigureAwait(false));
            }
            catch (Exception e)
            {
                if (e is OperationCanceledException)
                {
                    throw;
                }

                Logger.GetInstance(typeof(Sha256Impl)).Fatal($"Generating checksum by system in async error: {e}");
                UsingBouncyCastleFirst = true;
            }
            return(await DoGenerateInBase64Async(
                       file,
                       cancellationToken
                       ).ConfigureAwait(false));
        }
        /// <inheritdoc />
        protected override string OnGenerateInHex(string content)
        {
            if (UsingBouncyCastleFirst)
            {
                return(DoGenerateInHex(content));
            }

            try
            {
                return(DefaultSha256.DoGenerateInHex(content));
            }
            catch (Exception e)
            {
                Logger.GetInstance(typeof(Sha256Impl)).Fatal($"Generating checksum by system error: {e}");
                UsingBouncyCastleFirst = true;
            }
            return(DoGenerateInHex(content));
        }