examples/LocalSignalProtocolStore.js
function() {
    var groupId = getString(libsignal.crypto.getRandomBytes(16));
    return this.getGroup(groupId).then(function(group) {
      if (group === undefined) {
        return groupId;
      } else {
        console.warn("group id collision"); // probably a bad sign.
        return this.generateNewGroupId();
      }
    });
  }
function() {
    var groupId = getString(libsignal.crypto.getRandomBytes(16));
    return this.getGroup(groupId).then(function(group) {
      if (group === undefined) {
        return groupId;
      } else {
        console.warn("group id collision"); // probably a bad sign.
        return this.generateNewGroupId();
      }
    });
  }
function ( ) { var groupId = getString ( libsignal . crypto . getRandomBytes ( 16 ) ) ; return this . getGroup ( groupId ) . then ( function ( group ) { if ( group === undefined ) { return groupId ; } else { console . warn ( "group id collision" ) ; // probably a bad sign. return this . generateNewGroupId ( ) ; } } ) ; }
create a random group id that we haven't seen before.
create a random group id that we haven t seen before .