How to use the crc.hex32 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 CodeboxIDE / codebox / core / cb.core / workspace.js View on Github external
function Workspace(options, events) {
    options = _.defaults({}, options, {
        'id': null,
        'secret': uuid.v4(),
        'name': 'codebox',
        'public': true,
        'root': "./",
        'maxUsers': 100
    });

    // Public ID of workspace (ok to share)
    this.id = options.id || crc.hex32(crc.crc32(options.root));

    // Secret token used for securing cookies, sessions ...
    this.secret = options.secret;

    // Name
    this.name = options.name;

    // Public
    this.public = options.public;

    // Base folder
    this.root = options.root;

    // Mapping of users
    this._users = {};
    this.maxUsers = options.maxUsers;
github CodeboxIDE / codebox / core / cb.offline / main.js View on Github external
.then(function(installedAddons) {
            var revision = pkg.version+"-"+crc.hex32(crc.crc32(_.map(installedAddons, function(addon, addonName) {
                return addonName+":"+addon.infos.version;
            }).sort().join("-")));

            if (options.dev) revision = revision+"-"+startTime;
            
            // Clear manifest
            return manifest.clear(revision);
        })
        .then(function() {
github CodeboxIDE / codebox / lib / configs / default.js View on Github external
// Packages
        'packages': {
            // Path to store all packages for the user
            'root': undefined,

            // Path to default packages
            'defaults': path.resolve(__dirname, "../../packages"),

            // Packages to install when booting
            'install': {}
        }
    }, _.defaults);

    // Unique id for workspace
    options.id = options.id ||  crc.hex32(crc.crc32(options.root))

    return options;
};
github joyent / moray / lib / objects / put.js View on Github external
function _createEtag(req) {
    return (crc.hex32(crc.crc32(req._value)));
}
github CodeboxIDE / codebox / core / cb.files.sync / utils.js View on Github external
function hash(str) {
    return crc.hex32(crc.crc32(str));
}

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