class BitbayDigest extends BaseParamsDigest {

  private BitbayDigest(String secretKeyBase64) throws IllegalArgumentException {
    super(secretKeyBase64, HMAC_SHA_512);
  }

  public static BitbayDigest createInstance(String secretKeyBase64) {

    return secretKeyBase64 == null ? null : new BitbayDigest(secretKeyBase64);
  }

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


    try {
      Map<String, String> headers = restInvocation.getHttpHeadersFromParams();
      String apiKey = headers.get("API-Key");
      Long requestTimestamp = Long.parseLong(headers.get("Request-Timestamp"));
      String hashContent = apiKey + requestTimestamp;
      Mac mac = getMac();
      mac.update(hashContent.getBytes("UTF-8"));
      return String.format("%0128x", new BigInteger(1, mac.doFinal()));
    } catch (UnsupportedEncodingException e) {
      throw new RuntimeException("Illegal encoding, check the code.", e);
    }
  
<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