How can I generate a correct CRAM-MD5 response in PHP?

  md5, php, smtp

I wish to generate a CRAM-MD5 response for an SMTP server.

I can see the theoretical details of how to do so here: CRAM-MD5 Implementation, but I’m looking for the specific PHP code in order to implement it.

How can I implement this in PHP?

Source: Ask PHP