mybase64.c 407 Bytes
Newer Older
DESKTOP-KCR0QC9\28422 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
//
// Created by MyPC on 2021/4/17.
//


#include <openssl/base64.h>

int Base64Encode(const char *src, int src_length, char *encoded){
    return EVP_EncodeBlock((unsigned char*)encoded, (const unsigned char*)src, src_length);
}

int Base64Decode(const char *encoded, int encoded_length, char *decoded) {
    return EVP_DecodeBlock((unsigned char*)decoded, (const unsigned char*)encoded, encoded_length);
}