/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package factura40;

import java.util.Base64;

/**
 *
 * @author Usuario
 */
public class CodificadorBase64 {
    
    public String codificarBase64(String texto){
        Base64.Encoder encoder = Base64.getEncoder();
        byte[] encodedBytes = encoder.encode(texto.getBytes());
        return new String(encodedBytes);
    }    
    
    public String decodificarBase64(String texto){
        Base64.Decoder decoder = Base64.getDecoder();
        byte[] decodedBytes = decoder.decode(texto);
        return new String(decodedBytes);
    }
}
