sequaljs
Version:
JavaScript/TypeScript library for parsing and manipulating ProForma peptide sequence notation
13 lines (12 loc) • 389 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.calculateHashCode = calculateHashCode;
function calculateHashCode(input) {
let hash = 0;
for (let i = 0; i < input.length; i++) {
const char = input.charCodeAt(i);
hash = (hash << 5) - hash + char;
hash = hash & hash; // Convert to 32-bit integer
}
return hash;
}