How to use cabal-core - 4 common examples

To help you get started, we’ve selected a few cabal-core 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 fenwick67 / cabal-clone / lib / common / cabal-key-for-string.js View on Github external
// empty string / null => random new key
	if (!str){
		return randomKey();
	}

	// was passed an actual cabal://123abc key or just 64 chars that are all hex
	var edKey = str.toLowerCase().replace(/cabal:\/\/|[^\w\d]/ig,'');
	var strippedKey = edKey.replace(/[^a-f0-9]/ig,'');
	if (edKey.length == 64 && strippedKey.length == 64){
		return edKey;
	}

	// generate one based on string input
	return shajs('sha256')
		.update('cabal-clonev0:'+cabalCore.protocolVersion+':'+str,'utf8')
		.digest('hex');
}
github cabal-club / cabal-mobile / nodejs-assets / nodejs-project / main.js View on Github external
cabal.db.on('ready', function () {
    if (starting) cabal.joinChannel('default')
    const key = cabal.db.key.toString('hex')
    frontend.channel.send(JSON.stringify({type: 'ready', key}))
    cabalSwarm(cabal)
    cabal.getChannels(sendChannels)
  })
}
github cabal-club / cabal-client / index.js View on Github external
cabal.db.ready(function () {
      swarm(cabal)
    })
  }
github cabal-club / cabal-client / src / client.js View on Github external
static getDatabaseVersion () {
    return Cabal.databaseVersion
  }

cabal-core

p2p db functions for chat

AGPL-3.0
Latest version published 1 year ago

Package Health Score

49 / 100
Full package analysis