-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BMSPT-309] document guid is generated based on the document referenc…
…e guid and file name when the bcf is upgraded from 2.1 to 3.0
- Loading branch information
1 parent
38be9e8
commit 9c8e034
Showing
4 changed files
with
51 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System; | ||
using System.Security.Cryptography; | ||
using System.Text; | ||
|
||
namespace BcfToolkit.Utils; | ||
|
||
public static class GuidUtils { | ||
/// <summary> | ||
/// Method generates a new guid based on the input string. It creates an | ||
/// MD5 hash from the data, then turns to GUID. | ||
/// </summary> | ||
/// <param name="input">Input data on which the hash is generated.</param> | ||
/// <returns>Returns the GUID based on the input data.</returns> | ||
public static string NewGuidByContent(string input) { | ||
var hash = MD5.HashData(Encoding.UTF8.GetBytes(input)); | ||
return new Guid(hash).ToString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters