Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b39d83eb authored by Neil Fuller's avatar Neil Fuller
Browse files

Switch to HexEncoding from ByteStringUtils

Migration in preparation for deletion of ByteStringUtils.

Bug: 124232146
Test: build only
Change-Id: I9f18bb56eccf5bd628e1fd9068285f75623f7caf
parent 5b3a0d18
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@ import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.pm.Signature;

import libcore.util.HexEncoding;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.security.MessageDigest;
@@ -125,6 +127,10 @@ public final class PackageUtils {
     * @return The digest or null if an error occurs.
     */
    public static @Nullable String computeSha256Digest(@NonNull byte[] data) {
        return ByteStringUtils.toHexString(computeSha256DigestBytes(data));
        byte[] sha256DigestBytes = computeSha256DigestBytes(data);
        if (sha256DigestBytes == null) {
            return null;
        }
        return HexEncoding.encodeToString(sha256DigestBytes, true /* uppercase */);
    }
}