How to use the minimalistic-assert.equal function in minimalistic-assert

To help you get started, we’ve selected a few minimalistic-assert 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 jamesshore / lets_code_javascript / node_modules / browserify / node_modules / crypto-browserify / node_modules / public-encrypt / node_modules / parse-asn1 / node_modules / asn1.js / lib / asn1 / base / node.js View on Github external
Node.prototype._init = function init(body) {
  var state = this._baseState;

  assert(state.parent === null);
  body.call(this);

  // Filter children
  state.children = state.children.filter(function(child) {
    return child._baseState.parent === this;
  }, this);
  assert.equal(state.children.length, 1, 'Root node can have only one child');
};
github johanbrandhorst / protobuf / grpcweb / grpcwebjs / node_modules / asn1.js / lib / asn1 / base / node.js View on Github external
Node.prototype._init = function init(body) {
  var state = this._baseState;

  assert(state.parent === null);
  body.call(this);

  // Filter children
  state.children = state.children.filter(function(child) {
    return child._baseState.parent === this;
  }, this);
  assert.equal(state.children.length, 1, 'Root node can have only one child');
};
github sx1989827 / DOClever / Desktop / node_modules / des.js / lib / des / ede.js View on Github external
function EDEState(type, key) {
  assert.equal(key.length, 24, 'Invalid key length');

  var k1 = key.slice(0, 8);
  var k2 = key.slice(8, 16);
  var k3 = key.slice(16, 24);

  if (type === 'encrypt') {
    this.ciphers = [
      DES.create({ type: 'encrypt', key: k1 }),
      DES.create({ type: 'decrypt', key: k2 }),
      DES.create({ type: 'encrypt', key: k3 })
    ];
  } else {
    this.ciphers = [
      DES.create({ type: 'decrypt', key: k3 }),
      DES.create({ type: 'encrypt', key: k2 }),
      DES.create({ type: 'decrypt', key: k1 })
github indutny / crypto-deck / lib / poker / game.js View on Github external
function Game(options) {
  EventEmitter.call(this);

  this.options = options;

  assert.equal(typeof this.options.index, 'number',
               'options.index is required (number)');
  assert.equal(typeof this.options.playerCount, 'number',
               'options.players is required (number)');
  assert.equal(typeof this.options.rules, 'object',
               'options.rules is required (object)');
  this.rules = this.options.rules;

  this.index = this.options.index;
  this.playerCount = this.options.playerCount;
  this.players = new Array(this.playerCount);
  for (var i = 0; i < this.players.length; i++)
    this.players[i] = new Player();

  this.prev = this.index === 0 ? this.playerCount - 1 : this.index - 1;
  this.next = (this.index + 1) % this.playerCount;
github sx1989827 / DOClever / Client / node_modules / des.js / lib / des / des.js View on Github external
DES.prototype._unpad = function _unpad(buffer) {
  var pad = buffer[buffer.length - 1];
  for (var i = buffer.length - pad; i < buffer.length; i++)
    assert.equal(buffer[i], pad);

  return buffer.slice(0, buffer.length - pad);
};
github indutny / crypto-deck / lib / poker / controllers / visual.js View on Github external
function Visual(options) {
  EventEmitter.call(this);

  this.options = options;
  assert.equal(typeof this.options.cardCount, 'number',
               'options.cardCount is required (number)');

  this.cards = new Array(this.options.cardCount);
  for (var i = 0; i < this.cards.length; i++)
    this.cards[i] = new Card();
}
inherits(Visual, EventEmitter);
github indutny / crypto-deck / lib / crypto-deck / deck.js View on Github external
function Deck(options) {
  this.options = options;
  assert.equal(typeof this.options.curve, 'object',
               'options.curve is required (object)');
  assert.equal(typeof this.options.cardCount, 'number',
               'options.cardCount is required (number)');
  assert(this.options.cardCount <= 0xff, 'Can\'t have more than 255 cards');

  this.curve = this.options.curve;
  this.cards = [];

  this.rng = new cryptoDeck.RNG(this.options.entropy);

  this._shuffle = new Shuffle(this.rng, this.options.cardCount);
  this._shuffleSecret = this._randScalar();

  this._lockSecrets = [];
  this._locked = [];
github calvinmetcalf / native-crypto / der.js View on Github external
function fromDer(input, len) {
  var p = {};
  p.place = 0;
  assert.equal(input[p.place++], 0x30);
  getLength(input, p);
  assert.equal(input[p.place++], 0x02);
  var rlen = getLength(input, p);
  var r = input.slice(p.place, rlen + p.place);
  p.place += rlen;
  assert.equal(input[p.place++], 0x02);
  var slen = getLength(input, p);
  assert.equal(input.length, slen + p.place);
  var s = input.slice(p.place, slen + p.place);
  if (!r[0] && (r[1] & 0x80)) {
    r = r.slice(1);
  }
  if (!s[0] && (s[1] & 0x80)) {
    s = s.slice(1);
  }
  while (r.length < len) {
    r = Buffer.concat([new Buffer([0]), r]);
  }
  while (s.length < len) {
    s = Buffer.concat([new Buffer([0]), s]);
  }
  return Buffer.concat([r, s]);
}
function getLength(buf, p) {
github sx1989827 / DOClever / Client / node_modules / des.js / lib / des / des.js View on Github external
DES.prototype.deriveKeys = function deriveKeys(state, key) {
  state.keys = new Array(16 * 2);

  assert.equal(key.length, this.blockSize, 'Invalid key length');

  var kL = utils.readUInt32BE(key, 0);
  var kR = utils.readUInt32BE(key, 4);

  utils.pc1(kL, kR, state.tmp, 0);
  kL = state.tmp[0];
  kR = state.tmp[1];
  for (var i = 0; i < state.keys.length; i += 2) {
    var shift = shiftTable[i >>> 1];
    kL = utils.r28shl(kL, shift);
    kR = utils.r28shl(kR, shift);
    utils.pc2(kL, kR, state.keys, i);
  }
};
github calvinmetcalf / native-crypto / der.js View on Github external
function fromDer(input, len) {
  var p = {};
  p.place = 0;
  assert.equal(input[p.place++], 0x30);
  getLength(input, p);
  assert.equal(input[p.place++], 0x02);
  var rlen = getLength(input, p);
  var r = input.slice(p.place, rlen + p.place);
  p.place += rlen;
  assert.equal(input[p.place++], 0x02);
  var slen = getLength(input, p);
  assert.equal(input.length, slen + p.place);
  var s = input.slice(p.place, slen + p.place);
  if (!r[0] && (r[1] & 0x80)) {
    r = r.slice(1);
  }
  if (!s[0] && (s[1] & 0x80)) {
    s = s.slice(1);
  }
  while (r.length < len) {

minimalistic-assert

minimalistic-assert ===

ISC
Latest version published 7 years ago

Package Health Score

68 / 100
Full package analysis

Popular minimalistic-assert functions

Similar packages