Package org.fcrepo.kernel.api.utils
Class ContentDigest
- java.lang.Object
-
- org.fcrepo.kernel.api.utils.ContentDigest
-
public final class ContentDigest extends Object
Digest helpers to convert digests (checksums) into URI strings (based loosely on Magnet URIs)- Since:
- Mar 6, 2013
- Author:
- Chris Beer
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static URI
asURI(String algorithm, byte[] data)
Convert a MessageDigest algorithm and checksum byte-array data to a URNstatic URI
asURI(String algorithm, String value)
Convert a MessageDigest algorithm and checksum value to a URNstatic String
getAlgorithm(URI digestUri)
Given a digest URI, get the corresponding MessageDigest algorithm
-
-
-
Method Detail
-
asURI
public static URI asURI(String algorithm, String value)
Convert a MessageDigest algorithm and checksum value to a URN- Parameters:
algorithm
- the message digest algorithmvalue
- the checksum value- Returns:
- URI
-
asURI
public static URI asURI(String algorithm, byte[] data)
Convert a MessageDigest algorithm and checksum byte-array data to a URN- Parameters:
algorithm
- the message digest algorithmdata
- the checksum byte-array data- Returns:
- URI
-
getAlgorithm
public static String getAlgorithm(URI digestUri)
Given a digest URI, get the corresponding MessageDigest algorithm- Parameters:
digestUri
- the digest uri- Returns:
- MessageDigest algorithm
-
-