class OkexDigestV3 extends BaseParamsDigest {

  private static final String UTF_8 = "UTF-8";

  public OkexDigestV3(String secretKey) {
    super(secretKey, HMAC_SHA_256);
  }

  @Override
  public String digestParams(RestInvocation ri) {<FILL_FUNCTION_BODY>}
}

    String timestamp = ri.getHttpHeadersFromParams().get(OkexV3.OK_ACCESS_TIMESTAMP);
    String toSign =
        timestamp
            + ri.getHttpMethod()
            + ri.getPath()
            + (ri.getQueryString() != null && !ri.getQueryString().isEmpty()
                ? "?" + ri.getQueryString()
                : "")
            + (ri.getRequestBody() == null ? "" : ri.getRequestBody());
    byte[] signSHA256;
    try {
      signSHA256 = getMac().doFinal(toSign.getBytes(UTF_8));
    } catch (IllegalStateException | UnsupportedEncodingException e) {
      throw new ExchangeException("Could not sign the request", e);
    }
    return Base64.getEncoder().encodeToString(signSHA256);
  
<methods>public javax.crypto.Mac getMac() <variables>public static final java.lang.String HMAC_MD5,public static final java.lang.String HMAC_SHA_1,public static final java.lang.String HMAC_SHA_256,public static final java.lang.String HMAC_SHA_384,public static final java.lang.String HMAC_SHA_512,private final non-sealed javax.crypto.Mac mac