def encode(digest):
    '9.2.1.  Generating Signature'
    return base64.b64encode(digest).decode('ascii').rstrip('\n')
9.2.1.  Generating Signature
def encode(digest):
    
    return base64.b64encode(digest).decode('ascii').rstrip('\n')