There was quite a bit of duplicated code on generating a hash and doing the base64 encode, so this seemed like a good way to promote reusability.