How to use the jsbn.ZERO function in jsbn

To help you get started, we’ve selected a few jsbn 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 apache / apex-malhar / front / js / datatorrent / LogicalOperatorModel.js View on Github external
defaults: {
        appId: '',
        logicalName: '',
        className: '',
        containers: [],
        cpuPercentageMA: 0,
        currentWindowId: 0,     // new WindowId("0")
        recoveryWindowId: 0,    // new WindowId("75")
        failureCount: 1,
        hosts: [],
        ids: [],
        ports: [],
        lastHeartbeat: 0,
        latencyMA: 0,
        status: {},
        totalTuplesEmitted: BigInteger.ZERO,
        totalTuplesProcessed: BigInteger.ZERO,
        tuplesEmittedPSMA: BigInteger.ZERO,
        tuplesProcessedPSMA: BigInteger.ZERO,
        partitionCount: 0,
        containerCount: 0
    },

    initialize: function(attrs, options) {
        OperatorModel.prototype.initialize.call(this, attrs, options);

        if (options.keepPhysicalCollection) {
            this.physicalOperators = new OperatorCollection([], {
                dataSource: this.dataSource
            });
            this.physicalOperators.appId = this.get('appId');
        }
github apache / apex-malhar / front / js / datatorrent / LogicalOperatorModel.js View on Github external
return result;
                }()),
                */

                // min
                "lastHeartbeat": null, 
                // max
                "latencyMA": group[0]["latencyMA"],
                // same
                "logicalName": group[0]["logicalName"],
                // map of status => array of ids
                "status": {}, 
                // sum
                "totalTuplesEmitted": BigInteger.ZERO, 
                "totalTuplesProcessed": BigInteger.ZERO, 
                "tuplesEmittedPSMA": BigInteger.ZERO, 
                "tuplesProcessedPSMA": BigInteger.ZERO,
                partitionCount: 0,
                containerCount: 0
            });

            reduction.containerCount = reduction.containers.length;

            // Reduce ports
            /*
            if (reduction.ports.length) {
                reduction.ports = _.map(reduction.ports, function(portArray, name, list) {

                    return _.reduce(portArray, function(memo, port, i, list) {
                        _.each(['bufferServerBytesPSMA', 'totalTuples', 'tuplesPSMA'], function(key) {
                            memo[key] = memo[key].add(new BigInteger(port[key]));
                        });
github apache / apex-malhar / front / js / datatorrent / LogicalOperatorModel.js View on Github external
className: '',
        containers: [],
        cpuPercentageMA: 0,
        currentWindowId: 0,     // new WindowId("0")
        recoveryWindowId: 0,    // new WindowId("75")
        failureCount: 1,
        hosts: [],
        ids: [],
        ports: [],
        lastHeartbeat: 0,
        latencyMA: 0,
        status: {},
        totalTuplesEmitted: BigInteger.ZERO,
        totalTuplesProcessed: BigInteger.ZERO,
        tuplesEmittedPSMA: BigInteger.ZERO,
        tuplesProcessedPSMA: BigInteger.ZERO,
        partitionCount: 0,
        containerCount: 0
    },

    initialize: function(attrs, options) {
        OperatorModel.prototype.initialize.call(this, attrs, options);

        if (options.keepPhysicalCollection) {
            this.physicalOperators = new OperatorCollection([], {
                dataSource: this.dataSource
            });
            this.physicalOperators.appId = this.get('appId');
        }
    },

    url: function() {
github apache / apex-malhar / front / js / datatorrent / ContainerModel.js View on Github external
_.each(['tuplesProcessedPSMA','totalTuplesProcessed','tuplesEmittedPSMA','totalTuplesEmitted'], function(key) {
                    memo[key] = memo[key].add(new BigInteger(op[key]+''));
                });
                
                // lastHeartbeat
                memo.lastHeartbeat = op.lastHeartbeat;
                
                return memo;
            },
            {
                'currentWindowId': false,
                'recoveryWindowId': false,
                'tuplesProcessedPSMA': BigInteger.ZERO,
                'totalTuplesProcessed': BigInteger.ZERO,
                'tuplesEmittedPSMA': BigInteger.ZERO,
                'totalTuplesEmitted': BigInteger.ZERO
            }
        );

        _.each(['recoveryWindowId', 'currentWindowId'], function(wKey) {
            if (aggregates[wKey] === false) {
                aggregates[wKey] = '0';
            }
        });

        this.set(aggregates);
    },
github apache / apex-malhar / front / js / app / lib / widgets / OpChartWidget / lib / OpChartModel.js View on Github external
adjustOffsetForTail: function(newLimit, newTotal) {
        if (this.get('tail')) {
            // calculate new offset
            var limit = new BigInteger(newLimit ? newLimit+'' : this.get('limit')+'');
            var total = new BigInteger(newTotal ? newTotal+'' : this.get('totalTuples')+'');
            var newOffset = total.subtract(limit);
            if (newOffset.compareTo(BigInteger.ZERO) < 0) {
                newOffset = BigInteger.ZERO;
            }
            this.set('offset', newOffset.toString());
        }
    },
github apache / apex-malhar / front / js / datatorrent / RecordingModel.js View on Github external
validate: function(attrs) {
        var offset = new BigInteger(attrs.offset+'');
        var total = typeof this.getCurrentTotal === 'function' ? this.getCurrentTotal() : new BigInteger(this.get('totalTuples')+'') ;
        var upper = total.subtract(new BigInteger(attrs.limit+''));
        if (offset.compareTo(BigInteger.ZERO) < 0) return 'The offset cannot be less than zero.';
        if (offset.compareTo(upper) > 0) return 'The offset cannot exceed total.';
    },
github apache / apex-malhar / front / js / app / lib / widgets / OpChartWidget / lib / OpChartModel.js View on Github external
validate: function(attrs) {
        var offset = new BigInteger(attrs.offset+'');
        var total = typeof this.getCurrentTotal === 'function' ? this.getCurrentTotal() : new BigInteger(this.get('totalTuples')+'') ;
        var upper = total.subtract(new BigInteger(attrs.limit+''));
        if (offset.compareTo(BigInteger.ZERO) < 0) return 'The offset cannot be less than zero.';
        if (attrs.limit*1 > 300) return 'Limit cannot exceed 300.';
    },
github hardbyte / paillier.js / index.js View on Github external
function getprimeover(bitLength){

    function getNBitRand(n){
        return new bn(n, 1, rng);
    }

    var p = bn.ZERO;
    while(!p.isProbablePrime(20)){
        p = getNBitRand(bitLength);
    }
    return p;
}

jsbn

The jsbn library is a fast, portable implementation of large-number math in pure JavaScript, enabling public-key crypto and other applications on desktop and mobile browsers.

MIT
Latest version published 7 years ago

Package Health Score

67 / 100
Full package analysis