生成密码

Posted 影响力

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了生成密码相关的知识,希望对你有一定的参考价值。

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);
    }

}

 

以上是关于生成密码的主要内容,如果未能解决你的问题,请参考以下文章