• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

box / box-java-sdk-gen / #541

05 Sep 2025 02:31PM UTC coverage: 7.451% (-29.2%) from 36.66%
#541

push

other

web-flow
chore: release version 0.8.1 (#437)

1 of 1 new or added line in 1 file covered. (100.0%)

14652 existing lines in 1191 files now uncovered.

3737 of 50151 relevant lines covered (7.45%)

0.07 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/com/box/sdkgen/internal/utils/Hash.java
1
package com.box.sdkgen.internal.utils;
2

3
import com.box.sdkgen.box.errors.BoxSDKError;
4
import java.security.MessageDigest;
5
import java.security.NoSuchAlgorithmException;
6
import java.util.Base64;
7

8
public class Hash {
9

10
  private final HashName algorithm;
11
  private final MessageDigest digest;
12

UNCOV
13
  public Hash(HashName algorithm) {
×
UNCOV
14
    this.algorithm = algorithm;
×
15
    try {
UNCOV
16
      this.digest = MessageDigest.getInstance(algorithm.getValue());
×
17
    } catch (NoSuchAlgorithmException ae) {
×
18
      throw new BoxSDKError("Digest algorithm not found", ae);
×
UNCOV
19
    }
×
UNCOV
20
  }
×
21

22
  public void updateHash(byte[] data) {
UNCOV
23
    digest.update(data);
×
UNCOV
24
  }
×
25

26
  public String digestHash(String encoding) {
UNCOV
27
    byte[] digestBytes = digest.digest();
×
UNCOV
28
    return Base64.getEncoder().encodeToString(digestBytes);
×
29
  }
30

31
  public HashName getAlgorithm() {
32
    return algorithm;
×
33
  }
34
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc