

def EncodeData(self, raw_text_data, encoding):
    'Encodes raw data into an armored form.\n\n    Args:\n      raw_text_data: Textual data to be encoded; should be in utf-8 form.\n      encoding: Encoding to use (must be base64url)\n    Raises:\n      ValueError: The encoding is unknown or missing.\n    Returns:\n      The encoded data in the specified format.\n    '
    if (encoding != 'base64url'):
        raise ValueError(('Unknown encoding %s' % encoding))
    return base64.urlsafe_b64encode(unicode(raw_text_data).encode('utf-8')).encode('utf-8')

dataset/ETHPy150Open mimecuvalo/helloworld/packages/magicsig/__init__.py MagicEnvelopeProtocol.EncodeData/original