Hutool, a rich Java utility class library

Hutool, a rich Java utility class library

2022-09-02 0 824
Resource Number 38012 Last Updated 2025-02-24
¥ 0USD Upgrade VIP
Download Now Matters needing attention
Can't download? Please contact customer service to submit a link error!
Value-added Service: Installation Guide Environment Configuration Secondary Development Template Modification Source Code Installation

This edition recommends a small but complete library of Java utility classes-Hutool。

Hutool, a rich Java utility class library插图

Through static method encapsulation, Hutool reduces the learning cost of related apis, improves work efficiency, and makes Java have the expression ability of functional language, which is more convenient to use.

The tool method in Hutool comes from the elaboration of each user, it covers all aspects of the underlying code of Java development, it is not only a tool to solve small problems in the development of large projects, but also the efficiency of small projects.

Hutool is a friendly alternative to the “util” package in a project. It saves developers time to package common classes and common tool methods in the project, keeps development focused on the business, and minimizes bugs caused by imperfect packaging.

Hutool, a rich Java utility class library插图1

Inclusion component

A Java basic tool class, the file, stream, encryption and decryption, transcoding, regular, thread, XML and other JDK methods are encapsulated, composed of various Util tool classes, while providing the following components:

module

introduce

hutool-aop

JDK dynamic proxy package, providing non-IOC cross-section support

hutool-bloomFilter

Bloom filtering provides Bloom filtering for some Hash algorithms

hutool-cache

Simple cache implementation

hutool-core

Core, including Bean operations, dates, various UTILs, etc

hutool-cron

The Scheduled Tasks module, which provides scheduled tasks like Crontab expressions

hutool-crypto

Encryption and decryption module, providing symmetric, asymmetric and abstract algorithm encapsulation

hutool-db

JDBC encapsulated data manipulation, based on ActiveRecord ideas

hutool-dfa

Multi-keyword search based on DFA model

hutool-extra

Extension modules that encapsulate third parties (template engine, mail, Servlet, QR code, Emoji, FTP, word segmentation, etc.)

hutool-http

Http client encapsulation based on HttpUrlConnection

hutool-log

Automatically identify the log facade of the log implementation

hutool-script

Script execution encapsulation, such as Javascript

hutool-setting

More powerful Setting profiles and Properties encapsulation

hutool-system

System parameter call encapsulation (JVM information, etc.)

hutool-json

JSON come true

hutool-captcha

Image verification code implementation

hutool-poi

Encapsulation of Excel and Word in POI

hutool-socket

Socket encapsulation of NIO and AIO based on Java

hutool-jwt

JSON Web Token (JWT)Encapsulated implementation

install and use

Maven

<dependency>
    <groupId>cn.hutool</groupId>
    <artifactId>hutool-all</artifactId>
    <version>5.7.15</version>
</dependency>

Gradle

implementation 'cn.hutool:hutool-all:5.7.15'

Maven site:
https://repo1.maven.org/maven2/cn/hutool/hutool-all/5.7.15/

Example Codec coding

1.Base62 Encoding and decoding-Base62

Description:

The Base62 encoding consists of 10 digits, 26 uppercase letters, and 26 lowercase letters, and is mostly used in security fields and short URL generation.

Use:

String a = "A very long string 66";

// 17vKU8W4JMG8dQF8lk9VNnkdMOeWn4rJMva6F0XsLrrT53iKBnqo
String encode = Base62.encode(a);

// return to a
String decodeStr = Base62.decodeStr(encode);

2.Base64 Encoding and decoding-Base64

Description:

Base64 encoding is to use 64 (2 to the sixth power) ASCII characters to represent 256 (2 to the eighth power) ASCII characters, that is, a three-digit binary array after encoding into four ASCII characters displayed, the length increased by 1/3 than the original.

Use:

String a = "A very long string";
//5Lym5a625piv5LiA5Liq6Z2e5bi46ZW/55qE5a2X56ym5Liy
String encode = Base64.encode(a);

// return to a
String decodeStr = Base64.decodeStr(encode);

3.Morse Code. -Morse

Description:

Morse code, also known as Morse Code, is an on-off signal code that expresses letters, numbers, and punctuation symbols in different sequences.

Morse code is defined by dot (.) dash (-) is made up of two symbols.

Use:

//coding:
final Morse morseCoder = new Morse();
String text = "Hello World!";
// ...././.-../.-../---/-...../.--/---/.-./.-../-../-.-.--/
morseCoder.encode(text);
//decode:
String text = "Hello, world!";
// -..----.--...../-.--..-.-----.-/--------....--../-..---....-.--./---.-.-.-..--../--------.......-/
String morse = morseCoder.encode(text);
morseCoder.decode(morse);

4.BCD Code -BCD

Description:

BCD codes (Binary-Coded Decimal‎) are also called binary-coded decimal codes or binary-coded decimal codes.

BCD code This form of encoding uses four bits to store a decimal digit, so that the conversion between binary and decimal can be carried out quickly.

Use:

String strForTest = "123456ABCDEF";

// turn BCD
byte[] bcd = BCD.strToBcd(strForTest);

// decode BCD
String str = BCD.bcdToStr(bcd);

5.Turn the n-bit cipher -Rot

Description:

RotN (rotate by N places) is a simple substitution cipher, a variant of the Caesar cipher developed in ancient Rome.

Use:

String str = "1f2e9df6131b480b9fdddc633cf24996";

// 4s5r2qs9464o713o2sqqqp966ps57229
String encode13 = Rot.encode13(str);

// decode
String decode13 = Rot.decode13(encode13);

6.Punycode come true-PunyCode.md

Description:

Punycode is a coding system based on the RFC 3492 standard, which is used to convert domain names from the Unicode encoding used in local languages to the encoding used in the DNS system.

Use:

String text = "Hutool encoder";

// Hutool-ux9js33tgln
String strPunyCode = PunyCode.encode(text);

// Hutool encoder
String decode = PunyCode.decode("Hutool-ux9js33tgln");

// Hutool encoder
decode = PunyCode.decode("xn--Hutool-ux9js33tgln");

More usage documents: click download

资源下载此资源为免费资源立即下载
Telegram:@John_Software

Disclaimer: This article is published by a third party and represents the views of the author only and has nothing to do with this website. This site does not make any guarantee or commitment to the authenticity, completeness and timeliness of this article and all or part of its content, please readers for reference only, and please verify the relevant content. The publication or republication of articles by this website for the purpose of conveying more information does not mean that it endorses its views or confirms its description, nor does it mean that this website is responsible for its authenticity.

Ictcoder Free source code Hutool, a rich Java utility class library https://ictcoder.com/kyym/hutool-a-rich-java-utility-class-library.html

Share free open-source source code

Q&A
  • 1, automatic: after taking the photo, click the (download) link to download; 2. Manual: After taking the photo, contact the seller to issue it or contact the official to find the developer to ship.
View details
  • 1, the default transaction cycle of the source code: manual delivery of goods for 1-3 days, and the user payment amount will enter the platform guarantee until the completion of the transaction or 3-7 days can be issued, in case of disputes indefinitely extend the collection amount until the dispute is resolved or refunded!
View details
  • 1. Heptalon will permanently archive the process of trading between the two parties and the snapshots of the traded goods to ensure that the transaction is true, effective and safe! 2, Seven PAWS can not guarantee such as "permanent package update", "permanent technical support" and other similar transactions after the merchant commitment, please identify the buyer; 3, in the source code at the same time there is a website demonstration and picture demonstration, and the site is inconsistent with the diagram, the default according to the diagram as the dispute evaluation basis (except for special statements or agreement); 4, in the absence of "no legitimate basis for refund", the commodity written "once sold, no support for refund" and other similar statements, shall be deemed invalid; 5, before the shooting, the transaction content agreed by the two parties on QQ can also be the basis for dispute judgment (agreement and description of the conflict, the agreement shall prevail); 6, because the chat record can be used as the basis for dispute judgment, so when the two sides contact, only communicate with the other party on the QQ and mobile phone number left on the systemhere, in case the other party does not recognize self-commitment. 7, although the probability of disputes is very small, but be sure to retain such important information as chat records, mobile phone messages, etc., in case of disputes, it is convenient for seven PAWS to intervene in rapid processing.
View details
  • 1. As a third-party intermediary platform, Qichou protects the security of the transaction and the rights and interests of both buyers and sellers according to the transaction contract (commodity description, content agreed before the transaction); 2, non-platform online trading projects, any consequences have nothing to do with mutual site; No matter the seller for any reason to require offline transactions, please contact the management report.
View details

Related Article

make a comment
No comments available at the moment
Official customer service team

To solve your worries - 24 hours online professional service