Code example for MessageDigest

Methods: clone

0
         * 
         * @return a copy of MessageDigest 
         */ 
        private MessageDigest cloneDigest() {
            try { 
                return (MessageDigest)digest.clone();
            } catch (CloneNotSupportedException cnse) {
                throw Py.RuntimeError(String.format("_hashlib.HASH (%s) internal error", name));
            } 
        } 
 
        /** 
         * Safely calculate the digest without resetting state. 
         * 
         * @return a byte[] calculated digest 
         */ 
        private byte[] calculateDigest() { 
            return cloneDigest().digest();
        }