generate Salt - Android java.security

Android examples for java.security:Decrypt Encrypt

Description

generate Salt

Demo Code


//package com.java2s;

import java.math.BigInteger;

import java.security.SecureRandom;

public class Main {
    public static String generateSalt() {
        return new BigInteger(130, new SecureRandom()).toString(32);
    }/*  w  w w .jav a2  s . com*/
}

Related Tutorials