How to use the crc.crc16 function in crc

To help you get started, we’ve selected a few crc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github theVolary / feather / node_modules / connect / lib / utils.js View on Github external
Object.keys(obj).forEach(function(key){
    var val = obj[key];
    if (0 == val.indexOf('j:')) {
      try {
        hashes[key] = crc16(val); // only crc json cookies for now
        obj[key] = JSON.parse(val.slice(2));
      } catch (err) {
        // nothing
      }
    }
  });
github fruchtose / muxamp / node_modules / express / node_modules / connect / lib / middleware / session.js View on Github external
function hash(sess) {
  return crc16(JSON.stringify(sess, function(key, val){
    if ('cookie' != key) return val;
  }));
}
github jcoppieters / cody / node_modules / express / node_modules / connect / lib / middleware / session.js View on Github external
function hash(sess) {
  return crc16(JSON.stringify(sess, function(key, val){
    if ('cookie' != key) return val;
  }));
}
github patrickleet / bootstrap-override-boilerplate / theme-name / node_modules / connect / lib / middleware / session.js View on Github external
function hash(sess) {
  return crc16(JSON.stringify(sess, function(key, val){
    if ('cookie' != key) return val;
  }));
}
github rhiokim / haroopress / node_modules / express / node_modules / connect / lib / middleware / session.js View on Github external
function hash(sess) {
  return crc16(JSON.stringify(sess, function(key, val){
    if ('cookie' != key) return val;
  }));
}
github generalhenry / specificUser / node_modules / express / node_modules / connect / lib / middleware / session.js View on Github external
function hash(sess) {
  return crc16(JSON.stringify(sess, function(key, val){
    if ('cookie' != key) return val;
  }));
}
github gosquared / redis-clustr / index.js View on Github external
RedisClustr.prototype.selectClient = function(key) {
  if (Array.isArray(key)) key = key[0];
  var slot = crc16(key);

  for (var i in this.clients) {
    if (slot >= this.clients[i].slots[0] && slot <= this.clients[i].slots[1]) {
      return this.clients[i];
    }
  }
};
github hyron-group / hyron / lib / path.js View on Github external
function getURLByFunction(condition) {
    condition = condition.toString();
    var identityKey = crc.crc16(condition).toString(16);
    var completePath = cache[identityKey];
    if (completePath != null) {
        return completePath;
    } else {
        for (var curBaseUrl in pathHolder) {
            var instancePaths = pathHolder[curBaseUrl];
            for (var curPath in instancePaths) {
                var curHandle = pathHolder[curBaseUrl][curPath];
                if (curHandle.toString() == condition) {
                    completePath = curBaseUrl + curPath;
                    cache[identityKey] = completePath;
                    return completePath;
                }
            }
        }
    }

crc

Module for calculating Cyclic Redundancy Check (CRC) for Node.js and the browser.

MIT
Latest version published 1 year ago

Package Health Score

73 / 100
Full package analysis