# -*- coding: utf-8 -*-

import base64

from CodeConvert import CodeConvert as cc


def b64_encrypt(plaintext):
    return base64.urlsafe_b64encode(cc.Convert2Utf8(plaintext))


def b64_decrypt(ciphertext):
    return cc.Convert2Unicode(base64.urlsafe_b64decode(cc.Convert2Utf8(ciphertext)))
