개정판 09c5d530
Guid.cs 추가
Change-Id: I4a82fd4189ec7597aaa840a9e42f1a79b4702c37
FinalService/KCOM_FinalService/CommonLib/Guid.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
|
|
6 |
namespace CommonLib |
|
7 |
{ |
|
8 |
public static class Guid |
|
9 |
{ |
|
10 |
public static string shortGuid() |
|
11 |
{ |
|
12 |
byte[] bytes = new byte[16]; |
|
13 |
using (var provider = System.Security.Cryptography.RandomNumberGenerator.Create()) |
|
14 |
{ |
|
15 |
provider.GetBytes(bytes); |
|
16 |
} |
|
17 |
|
|
18 |
var guid = new System.Guid(bytes); |
|
19 |
|
|
20 |
return Convert.ToBase64String(guid.ToByteArray()) |
|
21 |
.Substring(0, 10) |
|
22 |
.Replace("/", "") |
|
23 |
.Replace("+", "") + DateTime.UtcNow.Ticks.ToString("x"); |
|
24 |
} |
|
25 |
} |
|
26 |
} |
내보내기 Unified diff