首页 > 技术文章 > 生成密码

thankyouGod 2017-06-28 11:09 原文

package me.cf81.util;


import me.cf81.commons.utils.EncryptUtils;

import java.util.UUID;

/**
 * 生成密码
 *
 */
public class GeneratePassword {

    public void testPassword() {
        String loginName = "userName";
        String salt = UUID.randomUUID().toString().replace("-", "");
        System.out.println(salt);
        String password = EncryptUtils.SHA256Encode("password" + salt);
        System.out.println(password);
    }

}

 

推荐阅读