Browse Source

期货日报数据接入

fea_dev_2023_09_07_zhidemaiAndQiHuo
yechuan 1 year ago
parent
commit
f3e912c2f2
1 changed files with 37 additions and 0 deletions
  1. +37
    -0
      common/src/main/java/tech/deepq/common/utils/signature/MD5SignatureService.java

+ 37
- 0
common/src/main/java/tech/deepq/common/utils/signature/MD5SignatureService.java View File

@@ -0,0 +1,37 @@
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;
}
}

Loading…
Cancel
Save