22 lines
636 B
Java
22 lines
636 B
Java
package com.cdzy.staff;
|
|
|
|
import com.cdzy.common.utils.SHA256WithSaltUtil;
|
|
import org.junit.jupiter.api.Test;
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
|
@SpringBootTest(classes = com.cdzy.staff.EbikeStaffApplication.class)
|
|
public class PasswordTest {
|
|
|
|
@Test
|
|
public void test() {
|
|
String salt = SHA256WithSaltUtil.generateSalt();
|
|
System.out.println(salt);
|
|
System.out.println(salt.length());
|
|
String password = "123456";
|
|
String encrypt = SHA256WithSaltUtil.encrypt(password, salt);
|
|
System.out.println(encrypt);
|
|
System.out.println(encrypt.length());
|
|
}
|
|
|
|
}
|