- Notifications
You must be signed in to change notification settings - Fork 549
/
Copy pathByteExtensions.cs
31 lines (26 loc) · 872 Bytes
/
ByteExtensions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
#if SQLSERVER
namespaceSystem.Data.Entity.SqlServer.Utilities
#elif SQLSERVERCOMPACT
namespaceSystem.Data.Entity.SqlServerCompact.Utilities
#else
namespaceSystem.Data.Entity.Utilities
#endif
{
usingSystem.Collections.Generic;
usingSystem.Globalization;
usingSystem.Text;
internalstaticclassByteExtensions
{
publicstaticstringToHexString(thisIEnumerable<byte>bytes)
{
DebugCheck.NotNull(bytes);
varstringBuilder=newStringBuilder();
foreach(var@byteinbytes)
{
stringBuilder.Append(@byte.ToString("X2",CultureInfo.InvariantCulture));
}
returnstringBuilder.ToString();
}
}
}