What's Here?
- Members: 103,037
- Replies: 397,403
- Topics: 60,066
- Snippets: 2,113
- Tutorials: 587
- Total Online: 1,420
- Members: 57
- Guests: 1,363
Who's Online?
|
Welcome to Dream.In.Code |
|
|
Getting C# Help is Easy!
Join 103,037 C# Programmers for FREE! Ask your question and get quick answers from experts. There are 1,420 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!
|
This is a snippet for applying a one way hash to a string using the CAPICOM.dll.
|
Submitted By: PsychoCoder
|
|
|
Rating:
|
|
Views: 402 |
Language: C#
|
|
Last Modified: May 12, 2008 |
Instructions: Will need to add a reference to CAPICOM.dll
Pass the method your string and it will return the hashed version |
Snippet
/// <summary>
/// method to hash the users password using CAPICOM.dll
/// </summary>
/// <returns></returns>
public string HashStringCAMICOM(string str)
{
//create our SHA1 provider
CAPICOM. HashedData sha = new CAPICOM. HashedData();
sha.Algorithm = CAPICOM_HASH_ALGORITHM.CAPICOM_HASH_ALGORITHM_SHA1;
//hash the value
sha.Hash(str);
//return the hashed value
return sha.Value;
}
Copy & Paste
|
|
|
Reference Sheets
Bye Bye Ads
Free DIC T-Shirt
Related Sites
Monthly Drawing
Partners
Top Contributors
Top 10 Kudos This Month
|