used by digester
185706
public void createPlugin(String id, String version) {
        descriptor = new GoPluginDescriptor(id, version, about, pluginJarFileLocation, pluginBundleLocation, isBundledPlugin);
    }
884192
public void update(byte buffer[], int off, int len) {
        if (skip) return;

        for (int i=0; i < digests.size(); i++) {
            digests.get(i).update(buffer, off, len);
        }
    }
888251
def digest(self):
        """"""
        total = 0                           # number of triplets seen
        if self.count == 3:                 # 3 chars = 1 triplet
            total = 1
        elif self.count == 4:               # 4 chars = 4 triplets
            total = 4
        elif self.count > 4:                # otherwise 8 triplets/char less
            total = 8 * self.count - 28     # 28 'missed' during 'ramp-up'

        threshold = total / 256             # threshold for accumulators, using the mean

        code = [0]*32                       # start with all zero bits
        for i in range(256):                # for all 256 accumulators
            if self.acc[i] > threshold:     # if it meets the threshold
                code[i >> 3] += 1 << (i&7)  # set corresponding digest bit, equivalent to i/8, 2 ** (i % 8)

        return code[::-1]
370972
private byte[] doDigest(byte[]... datas) {
		for (byte[] data : datas) {
			if (null != data) {
				this.digest.update(data);
			}
		}
		return this.digest.digest();
	}
183847
protected void addResourceAceRules(Digester digester, String xpath) {

        String xp_ace = xpath + N_ACCESSCONTROL_ENTRIES + "/" + N_ACCESSCONTROL_ENTRY;
        digester.addCallMethod(xp_ace, "addAccessControlEntry");
        digester.addCallMethod(xp_ace + "/" + N_ACCESSCONTROL_PRINCIPAL, "setAcePrincipalId", 0);
        digester.addCallMethod(xp_ace + "/" + N_FLAGS, "setAceFlags", 0);
        String xp_perms = xp_ace + "/" + N_ACCESSCONTROL_PERMISSIONSET + "/";
        digester.addCallMethod(xp_perms + N_ACCESSCONTROL_ALLOWEDPERMISSIONS, "setAcePermissionsAllowed", 0);
        digester.addCallMethod(xp_perms + N_ACCESSCONTROL_DENIEDPERMISSIONS, "setAcePermissionsDenied", 0);
    }
920572
function consumeWhitespace(remaining) {
  var match = remaining.match(/^\s+/);

  if (match) {
    var consumed = match[0];
    remaining = remaining.substring(consumed.length);
  }

  return remaining;
}
970765
def set_hash(self, algo, digest):
        """"""
        self.algo = algo
        self.digest = digest
457634
def blob_get(self, table, digest, chunk_size=1024 * 128):
        
        response = self._request('GET', _blob_path(table, digest), stream=True)
        if response.status == 404:
            raise DigestNotFoundException(table, digest)
        _raise_for_status(response)
        return response.stream(amt=chunk_size)
335356
@Override
    public void addRuleInstances (Digester digester)
    {
        // this creates the appropriate instance when we encounter a
        // <class> tag
        digester.addObjectCreate(_prefix + CLASS_PATH,
                                 ComponentClass.class.getName());

        // grab the attributes from the <class> tag
        SetPropertyFieldsRule rule = new SetPropertyFieldsRule();
        rule.addFieldParser("shadowColor", new FieldParser() {
            public Object parse (String text) {
                int[] values = StringUtil.parseIntArray(text);
                return new Color(values[0], values[1], values[2], values[3]);
            }
        });
        digester.addRule(_prefix + CLASS_PATH, rule);

        // parse render priority overrides
        String opath = _prefix + CLASS_PATH + "/override";
        digester.addObjectCreate(opath, PriorityOverride.class.getName());
        rule = new SetPropertyFieldsRule();
        rule.addFieldParser("orients", new FieldParser() {
            public Object parse (String text) {
                String[] orients = StringUtil.parseStringArray(text);
                ArrayIntSet oset = new ArrayIntSet();
                for (String orient : orients) {
                    oset.add(DirectionUtil.fromShortString(orient));
                }
                return oset;
            }
        });
        digester.addRule(opath, rule);

        digester.addSetNext(opath, "addPriorityOverride",
                            PriorityOverride.class.getName());
    }
294763
public function init()
    {
        $digest = $this->getDigest();
        $this->digestParts = $this->parseDigest((string) $digest);
    }
322348
protected void addUserInfoRules(Digester digester) {

        // add user additional information
        String rulePath = "*/" + N_USERINFOS;
        digester.addObjectCreate(rulePath, CmsWorkplaceUserInfoManager.class);
        digester.addSetNext(rulePath, "setUserInfoManager");
        // create a new block
        rulePath += "/" + N_INFOBLOCK;
        digester.addObjectCreate(rulePath, CmsWorkplaceUserInfoBlock.class);
        // set the title
        digester.addCallMethod(rulePath, "setTitle", 1);
        digester.addCallParam(rulePath, 0, A_NAME);
        // add a new entry
        digester.addCallMethod(rulePath + "/" + N_USERINFO, "addEntry", 5);
        digester.addCallParam(rulePath + "/" + N_USERINFO, 0, A_KEY);
        digester.addCallParam(rulePath + "/" + N_USERINFO, 1, A_TYPE);
        digester.addCallParam(rulePath + "/" + N_USERINFO, 2, A_WIDGET);
        digester.addCallParam(rulePath + "/" + N_USERINFO, 3, A_PARAMS);
        digester.addCallParam(rulePath + "/" + N_USERINFO, 4, A_OPTIONAL);
        // add the new created block
        digester.addSetNext(rulePath, "addBlock");
    }
154369
function digestFromManifestStr(manifestStr) {
    assert.string(manifestStr, 'manifestStr');

    var hash = crypto.createHash('sha256');
    var digestPrefix = 'sha256:';

    var manifest;
    try {
        manifest = JSON.parse(manifestStr);
    } catch (err) {
        throw new restifyErrors.InvalidContentError(err, fmt(
            'could not parse manifest: %s', manifestStr));
    }
    if (manifest.schemaVersion === 1) {
        try {
            var manifestBuffer = Buffer(manifestStr);
            var jws = _jwsFromManifest(manifest, manifestBuffer);
            hash.update(jws.payload, 'binary');
            return digestPrefix + hash.digest('hex');
        } catch (verifyErr) {
            if (!(verifyErr instanceof restifyErrors.InvalidContentError)) {
                throw verifyErr;
            }
            // Couldn't parse (or doesn't have) the signatures section,
            // fall through.
        }
    }
    hash.update(manifestStr);
    return digestPrefix + hash.digest('hex');
}
474960
function (digest, iterationCount) {

        var derive = function (password, salt, len) {
            var key, i, tmpBuf;
            if (len > digest.digestLength()) {
                throw "Key length larger than digest length";
            }
            digest.reset();
            digest.update(password);
            digest.update(salt);
            tmpBuf = digest.finalize();
            for (i = 1; i < iterationCount; i++) {
                tmpBuf = digest.digest(tmpBuf);
            }
            return tmpBuf.slice(0, len);
        };

        return {
            deriveKey: function (password, salt, len) {
                return derive(convertToUint8Array(password), convertToUint8Array(salt), len);
            }
        };
    }
279553
private byte[] getDigest(byte[] def, Configuration conf) {
    try {
      MessageDigest alg = MessageDigest.getInstance(conf.digestAlgorithm);
      return alg.digest(def);
    } catch (NoSuchAlgorithmException e) {
      throw new UnexpectedException(e);
    }
  }
331855
def csv_digest_gen(filepath, dialect, has_header, digest_types):
    

    with open(filepath, "rb") as csvfile:
        csvreader = csv.reader(csvfile, dialect=dialect)

        if has_header:
            # Ignore first line
            for line in csvreader:
                break

        for line in csvreader:
            yield digested_line(line, digest_types)
1049011
private byte[] resetAndRepeatDigest(byte[] digestData) {
		final int digestCount = Math.max(1, this.digestCount);
		reset();
		for (int i = 0; i < digestCount - 1; i++) {
			digestData = doDigest(digestData);
			reset();
		}
		return digestData;
	}
1226687
protected void addResourceRelationRules(Digester digester, String xpath) {

        String xp_rels = xpath + N_RELATIONS + "/" + N_RELATION;
        digester.addCallMethod(xp_rels, "addRelation");
        digester.addCallMethod(xp_rels + "/" + N_ID, "setRelationId", 0);
        digester.addCallMethod(xp_rels + "/" + N_PATH, "setRelationPath", 0);
        digester.addCallMethod(xp_rels + "/" + N_TYPE, "setRelationType", 0);
    }