SHARE
TWEET

Untitled

a guest Dec 13th, 2018 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     private String calculateCheckSum(NodeRef node) throws Exception {
  2.  
  3.         MessageDigest md = MessageDigest.getInstance("SHA-256");
  4.         ContentReader reader = this.serviceRegistry.getContentService().getReader(node, ContentModel.PROP_CONTENT);
  5.         InputStream is = reader.getContentInputStream();
  6.         DigestInputStream dis = new DigestInputStream(is, md);
  7.         byte[] digest = md.digest();
  8.         return digest.toString().toLowerCase();
  9.  
  10.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top