encode
A function to encode the given challenge into the byte buffer that the client expects. The role of encoding is moved over to the implementation as the server can provide its own implementations, should the client support any.
Parameters
buffer
the buffer into which to encode the challenge