? ??, DES ??? ? ???
import java.security.Key; import java.security.SecureRandom; import javax.crypto.Cipher; import javax.crypto.KeyGenerator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import sun.misc.BASE64Decoder; import sun.misc.BASE64Encoder; /** * DES是一種對(duì)稱加密算法,所謂對(duì)稱加密算法:加密和解密使用相同的秘鑰的算法 * @author llp * */ public class DESUtil { private static final Logger logger = LoggerFactory.getLogger(DESUtil.class); private static Key key; //設(shè)置秘鑰key private static String KEY_STR="myKey"; private static String CHARSETNAME="UTF-8"; private static String ALGORITHM="DES"; static{ try{ //生成DES算法對(duì)象 KeyGenerator generator=KeyGenerator.getInstance(ALGORITHM); //運(yùn)用SHA1安全策略 SecureRandom secureRandom=SecureRandom.getInstance("SHA1PRNG"); //設(shè)置上密鑰種子 secureRandom.setSeed(KEY_STR.getBytes()); //初始化基于SHA1的算法對(duì)象 generator.init(secureRandom); //生成密鑰對(duì)象 key=generator.generateKey(); generator=null; }catch(Exception e){ throw new RuntimeException(e); } } /** * 獲取加密的信息 * @param str * @return */ public static String getEncryptString(String str){ //基于BASE64編碼,接收byte[]并轉(zhuǎn)換成String BASE64Encoder base64Encoder=new BASE64Encoder(); try { // 按UTF8編碼 byte[] bytes = str.getBytes(CHARSETNAME); // 獲取加密對(duì)象 Cipher cipher = Cipher.getInstance(ALGORITHM); // 初始化密碼信息 cipher.init(Cipher.ENCRYPT_MODE, key); // 加密 byte[] doFinal = cipher.doFinal(bytes); // byte[]to encode好的String并返回 return base64Encoder.encode(doFinal); } catch (Exception e) { throw new RuntimeException(e); } } /** * 獲取解密之后的信息 * * @param str * @return */ public static String getDecryptString(String str) { // 基于BASE64編碼,接收byte[]并轉(zhuǎn)換成String BASE64Decoder base64decoder = new BASE64Decoder(); try { // 將字符串decode成byte[] byte[] bytes = base64decoder.decodeBuffer(str); // 獲取解密對(duì)象 Cipher cipher = Cipher.getInstance(ALGORITHM); // 初始化解密信息 cipher.init(Cipher.DECRYPT_MODE, key); // 解密 byte[] doFinal = cipher.doFinal(bytes); // 返回解密之后的信息 return new String(doFinal, CHARSETNAME); } catch (Exception e) { throw new RuntimeException(e); } } public static void main(String[] args) { //加密 logger.info(getEncryptString("root"));//WnplV/ietfQ= logger.info(getEncryptString("123456"));//QAHlVoUc49w= //解密 logger.info(getDecryptString(getEncryptString("root")));//root logger.info(getDecryptString(getEncryptString("123456")));//123456 } }
? ??, MD5 ???
import java.security.MessageDigest; /** * MD5加密 * @author llp * */ public class MD5 { /** * 對(duì)傳入的String進(jìn)行MD5加密 * * @param s * @return */ public static final String getMd5(String s) { // 16進(jìn)制數(shù)組 char hexDigits[] = { '5', '0', '5', '6', '2', '9', '6', '2', '5', 'q', 'b', 'l', 'e', 's', 's', 'y' }; try { char str[]; // 將傳入的字符串轉(zhuǎn)換成byte數(shù)組 byte strTemp[] = s.getBytes(); // 獲取MD5加密對(duì)象 MessageDigest mdTemp = MessageDigest.getInstance("MD5"); // 傳入需要加密的目標(biāo)數(shù)組 mdTemp.update(strTemp); // 獲取加密后的數(shù)組 byte md[] = mdTemp.digest(); int j = md.length; str = new char[j * 2]; int k = 0; // 將數(shù)組做位移 for (int i = 0; i < j; i++) { byte byte0 = md[i]; str[k++] = hexDigits[byte0 >>> 4 & 0xf]; str[k++] = hexDigits[byte0 & 0xf]; } // 轉(zhuǎn)換成String并返回 return new String(str); } catch (Exception e) { return null; } } public static void main(String[] args) { System.out.println(MD5.getMd5("123456"));//s05bse6q2qlb9qblls96s592y55y556s } }
PHP ??? ?????? ?? JAVA ?? ????? ?? ????. ??? ?????. ???!
? ??? ???? ????? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

JDBC ????? ???? ????? ?? ?? ?? ??? ?? ?? ??? ?? ? ?? ??? ?? ?? ?? ??? ???????. 1. ????? ????? Conn.SetAutoCommit (False)?? ??????. 2. ??? ? ????? ?? ?? SQL ??? ?????. 3. ?? ??? ??? ?? Conn.commit ()?? ???? ??? ???? ???? ?? ??? ???? Conn.Rollback ()?? ??????. ???, ? ??? ???? ????, ??? ???? ????, ?? ??? ??? ?? ??? ??? ???? ? ???????. ?? ?? ?? ???? ????? ??? ???? ?? ?? ???? ???? ??? ????? ?? ??? ??? ? ?? ???? ?? ????.

?? ?? ? ?? ???? ???? ?? Java.Time ???? ???? ??????. 2. LocalDate, LocalDateTime ? LocalTime? ?? ?? ??? ??? ?????. 3. () ???? ???? ?? ??? ??? ????. 4. ???/???? ??? ???? ??? ????? ??? ??????. 5. ZonedDateTime ? Zoneid? ???? ???? ??????. 6. DateTimeFormatter? ?? ?? ? ?? ?? ?? ???; 7. ??? ?? ?? ?? ??? ????? ?? ??????. ?? Java? ?? ??? ???? ??? ??? ???? Java.Timeapi ??? ?? ??? ???????.

Pre-FormancetArtUptimeMoryUsage, Quarkusandmicronautleadduetocompile-timeprocessingandgraalvsupport, withquarkusoftenperforminglightbetterine serverless sinarios.2.thyvelopecosyste,

Java 's Garbage Collection (GC)? ???? ???? ???? ??????, ?? ? ??? ??? ? ??? ??? ??? ??? ????. 1.GC? ?? ?? (? : ?? ??, ?? ???, ?? ?? ?)?? ??? ???? ????, ?? ? ??? ??? ???? ?????. 2. ?? ???? ????? ????, ?? ?? ??? ??? ???? ?? ??? ??????. 3. ?? ?? ?? ?? : ??? ?? (Eden, S0, S1)? ?? ????? ?????. ??? ??? ?? ? MajorGC? ???? ? ??? ? ????. Metaspace? ??? ?? ???? ?????. 4. JVM? ??? GC ??? ?????. SerialGC? ??? ?? ????? ?????. ParallelGC? ???? ??????. CMS? ?? ???

??? htmlinput ??? ???? ??? ???? ????? ??? ??? ?? ??? ???? ???? ? ????. 1. ???, ???, ??, ?? ? ??? ?? ??? ??? ?? ?? ?? ??? ???? ???? ??? ? ???? ??? ? ????. 2. HTML5? ?????? ??? ? ?? ?? ??? ?? ? ??? URL, ??, ?? ? ??? ?? ??? ??? ??????. 3. ?? ?? ? ? ??? ??? ???? ?? ??? ???? ???? ?? ???? ?? ???? ???? ?? ? ? ??? ?? ???????.

GradleisBetTerChoiceFormostNewProjectSduetoitssuperiorflexible, Performance, and ModernToolingsupport.1.Gradle'Sgroovy/kotlindslismoreConcisENDEXPRESSIVETHANMAVEN'SVOSEXML.2.GradleOutsMaveninbuildweedweedweedweedweedweedweedweedweedweedweedweedweedweede

DEFER? ??? ???? ?? ??? ??? ???? ? ?????. ?? ??? ?? ? ? ?? ????, ??? ??? ? ?? ?? (LIFO)? ??? ?????. 1. ?? ??? ??? ? ??? ?????. 2. ?? ??? ?? ??? ??? ????? ?????. 3. ?? ? ?? ?? ??? ? ????. 4. ??? ?????? ??? ??? ???? ?????. 5. ?? ??? ???? ?? ??? ?? ??? ?????. ??? ??? ?? ?? ? ???? ???? ? ????.

GO? HTTP ?? ????? ?? ??, ??, ????? IP ? ?? ??? ?? ? ? ????. 1. http.handlerfunc? ???? ????? ????, 2. ??? ???? ?? ?? ??? ?? ??? ??????. ?? ?? ??? ???? ??? ?????? ??? ????? ???? ? ?????. ?? ???? ?? ?? ??, JSON ?? ?? ? ?? ID ??? ?????.
