title: How can i encode a string in base64 using meteor
body: <p>I am trying to use a form to upload files to a s3 bucket using <a href="http://www.meteor.com/" rel="nofollow">Meteor</a>. I am following this amazon <a href="http://aws.amazon.com/articles/1434" rel="nofollow">article</a>. At "Sign Your S3 POST Form", near the end, I need to encode a string to base64 but I've been unable to find a way to do this. Can anyone tell me how to do this? Notice that the string first needs to be encoded and then signed. This is how it's done in python:</p>
  
  <pre><code>import base64
  import hmac, hashlib
  
  policy = base64.b64encode(policy_document)
  signature = base64.b64encode(hmac.new(AWS_SECRET_ACCESS_KEY, policy, hashlib.sha1).digest())
  </code></pre>