Permalink
Browse files

Encoding username for use in headers

  • Loading branch information...
1 parent d75aa11 commit 06fc56a88c58b420a181ca27033d8aa834855c99 @thedjpetersen committed Aug 4, 2011
Showing with 5 additions and 0 deletions.
  1. +5 −0 auth.py
View
@@ -0,0 +1,5 @@
+from base64 import encodestring as base64
+
+def encode_auth(username, password):
+ auth = base64('%s:%s' % (username, password)).replace('\n', '')
+ return auth

0 comments on commit 06fc56a

Please sign in to comment.