Correction to hash order and new code examples

Corrected the order of parameters when hashing (this was an error in the doc) and also added two code samples at the bottom of the page to make it even more clear how the hashing works.