hutool 进行 sha 256 加密

Hutool是一个Java工具包,它提供了许多实用的工具类,包括加密工具。可以使用Hutool的DigestUtil类来进行SHA-256加密。

以下是一个示例代码,演示如何使用Hutool的DigestUtil类进行SHA-256加密:

import cn.hutool.crypto.digest.DigestAlgorithm;  
import cn.hutool.crypto.digest.DigestUtil;  
  
public class HutoolSha256Example {  
    public static void main(String[] args) {  
        String input = "Hello World";  
        String sha256 = DigestUtil.sha256Hex(input);  
        System.out.println(sha256);  
    }  
}

你可能感兴趣的:(java,开发语言)