What is BitCoin?
Bitcoin is a peer-to-peer digital currency. Peer-to-peer (P2P) means that there is no central authority to issue new money or keep track of transactions. Instead, these tasks are managed collectively by the nodes of the network.
Bitcoin is a peer-to-peer digital currency. Peer-to-peer (P2P) means that there is no central authority to issue new money or keep track of transactions. Instead, these tasks are managed collectively by the nodes of the network.
If you’ve ever wondered what version of .NET to target, this post will hopefully shed some light on the situation and let you make an informed decision.
You guys know that I’m not a cryptography expert. In fact, I didn’t use hashing and salting well until my second year as a programmer during college.
It’s recently come to my attention that using MD5 or SHA as your hashing methods is not good enough.
Alright, I’m the first to admit that I’ve done my share of plaintext saving passwords to the database. Not my proudest hour. Then of course the software I was working on wasn’t exactly for a nuclear silo, just a simple ice cream store. 🙂
Still! I’ve searched the web and after a bit of elbow grease I came up with this simple and easy to follow example on how to hash and salt your passwords.
If you’d like to know what hashing and salting is, Google it. 😀
Basically it turns this:
“Sergio”
Into this:
“B00nqRY/9yGjbczZLDQV6nbZCuSHqyzotEwnp212GW8=”
You like good looking code right? Who doesn’t!
This bit of code I picked up from the excellent book: Pro ASP.Net MVC2.
When you’re unit testing, you might do something like this:
using NUnit.Framework [Test] public void Product_Catalog_Should_List_All_Products() { var viewModelResult = productsController.List(); var productCount = viewModelResult.Products.Count; Assert.AreEqual(3, productCount); }
Let’s create a little helper method that makes our code a little bit sexier (lord knows I like sexy code):
public static class UnitTestHelpers { public static void ShouldEqual<T>(this T actualValue, T expectedValue) { Assert.AreEqual(expectedValue, actualValue); } }
BEHOLD! GENERICS!
Now, let’s spruce up our old unit test. 😉
using NUnit.Framework [Test] public void Product_Catalog_Should_List_All_Products() { var viewModelResult = productsController.List(); var productCount = viewModelResult.Products.Count; productsCount.ShouldEqual(3); }
Now is that nice or what! 🙂
Added bonus, Visual Studio’s intellisense is fully helping you out while coding.
Enjoy!