encryption/builder.js
function(options) {
    if (!options) options = {};
    this.initTime = options.initTime || new Date().getTime();
    this.time_since_start = options.time_since_start || null;
    this.time = options.time || null;
    this.version = options.version || '0.45';
    this.forcedUk25 = options.uk25 || null;
    if (options.protos) {
        this.ProtoSignature = options.protos.Networking.Envelopes.Signature;
    } else {
        throw new Error('Passing protos object is now mandatory.');
    }

    this.utils = new Utils();

    this.fields = {
        session_hash: options.session_hash || options.unk22 || crypto.randomBytes(16)
    };
}
function(options) {
    if (!options) options = {};
    this.initTime = options.initTime || new Date().getTime();
    this.time_since_start = options.time_since_start || null;
    this.time = options.time || null;
    this.version = options.version || '0.45';
    this.forcedUk25 = options.uk25 || null;
    if (options.protos) {
        this.ProtoSignature = options.protos.Networking.Envelopes.Signature;
    } else {
        throw new Error('Passing protos object is now mandatory.');
    }

    this.utils = new Utils();

    this.fields = {
        session_hash: options.session_hash || options.unk22 || crypto.randomBytes(16)
    };
}
function ( options ) { if ( ! options ) options = { } ; this . initTime = options . initTime || new Date ( ) . getTime ( ) ; this . time_since_start = options . time_since_start || null ; this . time = options . time || null ; this . version = options . version || '0.45' ; this . forcedUk25 = options . uk25 || null ; if ( options . protos ) { this . ProtoSignature = options . protos . Networking . Envelopes . Signature ; } else { throw new Error ( 'Passing protos object is now mandatory.' ) ; } this . utils = new Utils ( ) ; this . fields = { session_hash : options . session_hash || options . unk22 || crypto . randomBytes ( 16 ) } ; }
the signature builder
@constructor
@param {Object} [options] - a set of options and defaults to send to the signature builder
@param {number} [options[].initTime] - time in ms to use as the app's startup time
@param {Buffer} [options[].unk22] - a 32-byte Buffer to use as `unk22`
@param {String} [options[].version] - The version to run on, defaults to 0.45
the signature builder