siss 0 Newbie Poster

can anyone convert this to flex code?

def encypt(string, key):
h = hmac.new(key, string, hashlib.sha1)
 #  print '\n' + h.digest()
return base64.b64encode(h.digest())

I have to use hmac sha1 in my flex code.