SHA-256 使用教程

Lu Lv3

SHA-256 使用教程

引入Maven依赖

1
2
3
4
5
6
<!--SHA-256加密-->
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.17.0</version>
</dependency>

使用方法

1
String password = DigestUtils.sha256Hex("123456");

这里的 DigestUtils类需要使用 apache 下的,而不是 spring-framework

  • Title: SHA-256 使用教程
  • Author: Lu
  • Created at : 2024-07-16 21:28:25
  • Updated at : 2024-07-16 22:18:05
  • Link: https://lusy.ink/2024/07/16/使用SHA-256加密处理/
  • License: This work is licensed under CC BY-NC-SA 4.0.
Comments