<commit_before>﻿namespace Bakery.Security
{
	using System;
	using System.Text;
	using Text;

	public class BasicAuthenticationParser
		: IBasicAuthenticationParser
	{
		private readonly IBase64Parser base64Parser;
		private readonly Encoding encoding;

		public BasicAuthenticationParser(IBase64Parser base64Parser, Encoding encoding)
		{
			if (base64Parser == null)
				throw new ArgumentNullException(nameof(base64Parser));

			if (encoding == null)
				throw new ArgumentNullException(nameof(encoding));

			this.base64Parser = base64Parser;
			this.encoding = encoding;
		}

		public IBasicAuthentication TryParse(String @string)
		{<commit_msg>Consistent with .NET Framework methods, don't throw an exception if input to a TryParse() method is null.<commit_after>﻿namespace Bakery.Security
{
	using System;
	using System.Text;
	using Text;

	public class BasicAuthenticationParser
		: IBasicAuthenticationParser
	{
		private readonly IBase64Parser base64Parser;
		private readonly Encoding encoding;

		public BasicAuthenticationParser(IBase64Parser base64Parser, Encoding encoding)
		{
			if (base64Parser == null)
				throw new ArgumentNullException(nameof(base64Parser));

			if (encoding == null)
				throw new ArgumentNullException(nameof(encoding));

			this.base64Parser = base64Parser;
			this.encoding = encoding;
		}

		public IBasicAuthentication TryParse(String @string)
		{
			// Consistent with .NET Framework methods, TryParse() won't throw an
			// ArgumentNullException if the supplied input is null.

			if (@string == null)
				return null;

{'fraction_non_alphanumeric': 0.07407407407407407, 'fraction_numerical': 0.020434227330779056, 'mean_word_length': 4.761029411764706, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4035908', 'n_tokens_mistral': 506, 'n_tokens_neox': 420, 'n_words': 127}