MCPcopy Create free account
hub / github.com/apache/cassandra-nodejs-driver / hash

Method hash

lib/tokenizer.js:370–376  ·  view source on GitHub ↗

* @param {Buffer|Array} value * @returns {RandomToken}

(value)

Source from the content-addressed store, hash-verified

368 * @returns {RandomToken}
369 */
370 hash(value) {
371 if (Array.isArray(value)) {
372 value = utils.allocBufferFromArray(value);
373 }
374 const hashedValue = this._crypto.createHash('md5').update(value).digest();
375 return new token.RandomToken(Integer.fromBuffer(hashedValue).abs());
376 }
377
378 /**
379 * @returns {Token}

Callers

nothing calls this directly

Calls 1

updateMethod · 0.65

Tested by

no test coverage detected