Pārlūkot izejas kodu

值得买+期货日报

fea_dev_2023_09_07_zhidemaiAndQiHuo
yechuan pirms 1 gada
vecāks
revīzija
a0366e06e4
2 mainītis faili ar 1 papildinājumiem un 38 dzēšanām
  1. +0
    -37
      common/src/main/java/tech/deepq/common/utils/signature/MD5SignatureService.java
  2. +1
    -1
      common/src/main/java/tech/deepq/common/utils/signature/Md5SignatureService.java

+ 0
- 37
common/src/main/java/tech/deepq/common/utils/signature/MD5SignatureService.java Parādīt failu

@@ -1,37 +0,0 @@
package tech.deepq.common.utils.signature;

import org.springframework.util.DigestUtils;
import tech.deepq.common.dto.SignatureConfig;

import java.nio.charset.StandardCharsets;
import java.security.GeneralSecurityException;

/**
* @author yechuan
* @since 2023/9/1 09:46
**/
public class MD5SignatureService extends AbstractSignatureService {

private final static MD5SignatureService instance = new MD5SignatureService();

private MD5SignatureService() {

}

public static AbstractSignatureService getInstance(SignatureConfig signatureConfig) throws GeneralSecurityException {
return instance;
}

/**
* 对content进行加密
*/
@Override
public String signatureContent(String content) {
return DigestUtils.md5DigestAsHex((content).getBytes(StandardCharsets.UTF_8));
}

@Override
void init(SignatureConfig signatureConfig) {
return;
}
}

+ 1
- 1
common/src/main/java/tech/deepq/common/utils/signature/Md5SignatureService.java Parādīt failu

@@ -27,7 +27,7 @@ class Md5SignatureService extends AbstractSignatureService {
* @throws GeneralSecurityException
*/
@Override
public String signature(String content) throws GeneralSecurityException {
public String signatureContent(String content) throws GeneralSecurityException {
return DigestUtils.md5DigestAsHex(content.getBytes(StandardCharsets.UTF_8)).toUpperCase();
}
}

Notiek ielāde…
Atcelt
Saglabāt