Hutool, a rich Java utility class library

Hutool, a rich Java utility class library

2022-09-02 0 1,264
Resource Number 38012 Last Updated 2025-02-24
¥ 0HKD 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/hutool-a-rich-java-utility-class-library/

Share free open-source source code

Q&A
  • 1. Automatic: After making an online payment, click the (Download) link to download the source code; 2. Manual: Contact the seller or the official to check if the template is consistent. Then, place an order and make payment online. The seller ships the goods, and both parties inspect and confirm that there are no issues. ICTcoder will then settle the payment for the seller. Note: Please ensure to place your order and make payment through ICTcoder. If you do not place your order and make payment through ICTcoder, and the seller sends fake source code or encounters any issues, ICTcoder will not assist in resolving them, nor can we guarantee your funds!
View details
  • 1. Default transaction cycle for source code: The seller manually ships the goods within 1-3 days. The amount paid by the user will be held in escrow by ICTcoder until 7 days after the transaction is completed and both parties confirm that there are no issues. ICTcoder will then settle with the seller. In case of any disputes, ICTcoder will have staff to assist in handling until the dispute is resolved or a refund is made! If the buyer places an order and makes payment not through ICTcoder, any issues and disputes have nothing to do with ICTcoder, and ICTcoder will not be responsible for any liabilities!
View details
  • 1. ICTcoder will permanently archive the transaction process between both parties and snapshots of the traded goods to ensure the authenticity, validity, and security of the transaction! 2. ICTcoder cannot guarantee services such as "permanent package updates" and "permanent technical support" after the merchant's commitment. Buyers are advised to identify these services on their own. If necessary, they can contact ICTcoder for assistance; 3. When both website demonstration and image demonstration exist in the source code, and the text descriptions of the website and images are inconsistent, the text description of the image shall prevail as the basis for dispute resolution (excluding special statements or agreements); 4. If there is no statement such as "no legal basis for refund" or similar content, any indication on the product that "once sold, no refunds will be supported" or other similar declarations shall be deemed invalid; 5. Before the buyer places an order and makes payment, the transaction details agreed upon by both parties via WhatsApp or email can also serve as the basis for dispute resolution (in case of any inconsistency between the agreement and the description of the conflict, the agreement shall prevail); 6. Since chat records and email records can serve as the basis for dispute resolution, both parties should only communicate with each other through the contact information left on the system when contacting each other, in order to prevent the other party from denying their own commitments. 7. Although the probability of disputes is low, it is essential to retain important information such as chat records, text messages, and email records, in case a dispute arises, so that ICTcoder can intervene quickly.
View details
  • 1. As a third-party intermediary platform, ICTcoder solely protects transaction security and the rights and interests of both buyers and sellers based on the transaction contract (product description, agreed content before the transaction); 2. For online trading projects not on the ICTcoder platform, any consequences are unrelated to this platform; regardless of the reason why the seller requests an offline transaction, please contact the administrator to report.
View details

Related Source code

ICTcoder Customer Service

24-hour online professional services