Move hash and base64 functions to utils