Skip to content

Commit 4680ab7

Browse files
committed
Removed net6.0 and net7.0 from TargetFrameworks
1 parent 1edfae8 commit 4680ab7

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

source/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Project>
33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
55
<ImplicitUsings>disable</ImplicitUsings>
66
<Nullable>disable</Nullable>
77
<Authors>Daniel Collingwood</Authors>

source/MailKitSimplified.Sender/Helpers/MailboxAddressHelper.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,21 @@ public static class MailboxAddressHelper
1010
private static readonly char[] _emailReplace = new char[] { '_', '.', '-' };
1111
private static readonly char[] _emailSeparator = new char[] { ';', ',', ' ', '&', '|' };
1212

13+
#if NET5_0_OR_GREATER
14+
/// <summary>
15+
/// Truncated hexadecimal string with up to 16^32 combinations, used for logging.
16+
/// </summary>
17+
/// <param name="count">Base 16 exponent.</param>
18+
/// <returns>Truncated hexadecimal string</returns>
19+
public static string GenerateHexId(byte count = 32)
20+
{
21+
if (count > 32)
22+
count = 32;
23+
var uuid = Guid.NewGuid().ToString("n", null)[..count];
24+
return uuid;
25+
}
26+
#endif
27+
1328
public static IEnumerable<MailboxAddress> ParseEmailContacts(string value)
1429
{
1530
IEnumerable<MailboxAddress> contacts = null;

0 commit comments

Comments
 (0)