Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.util.Base64;

public class Main {
    /**
     * Metodo che converte la password in Base64
     * @param string = password in chiaro
     * @return password cifrata
     */
    public static String encodePassword(String string) {
        byte[] data = string.getBytes();
        return Base64.encodeToString(data, Base64.DEFAULT);
    }
}