How to use the elliptic/package.json.version function in elliptic

To help you get started, we’ve selected a few elliptic 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 ethers-io / ethers.js / Gruntfile.js View on Github external
'use strict';

var through = require('through');

// The elliptic package.json is only used for its version
var ellipticPackage = require('elliptic/package.json');
ellipticPackage = JSON.stringify({ version: ellipticPackage.version });

var version = require('./package.json').version;


var undef = "module.exports = undefined;";
var empty = "module.exports = {};";

// We already have a random Uint8Array browser/node safe source
// @TODO: Use path construction instead of ../..
var brorand = "var randomBytes = require('../../utils').randomBytes; module.exports = function(length) { return randomBytes(length); };";

var transforms = {
    'ethers.js/package.json': JSON.stringify({ version: version }),

    // Remove the precomputed secp256k1 points
    "elliptic/lib/elliptic/precomputed/secp256k1.js": undef,
github ethers-io / ethers.js / gulpfile.js View on Github external
function taskBundle(name, options) {
    var show = options.show || { };

    // The elliptic package.json is only used for its version
    var ellipticPackage = require('elliptic/package.json');
    ellipticPackage = JSON.stringify({ version: ellipticPackage.version });

    var version = require('./package.json').version;

    var undef = "module.exports = undefined;";
    var empty = "module.exports = {};";

    // This is only used in getKeyPair, which we do not use; but we'll
    // leave it in tact using the browser crypto functions
    var brorand = "module.exports = function(length) { var result = new Uint8Array(length); (global.crypto || global.msCrypto).getRandomValues(result); return result; }";

    // setImmediate is installed globally by our src.browser/shims.ts, loaded from src.ts/index.ts
    var process = "module.exports = { browser: true };";
    var timers = "module.exports = { setImmediate: global.setImmediate }; ";

    function readShim(filename) {
        return fs.readFileSync('./shims/' + filename + '.js').toString();
github ethers-io / ethers.js / packages / ethers / scripts / transform.js View on Github external
'use strict';

const fs = require('fs');
const path = require('path');
const through = require('through');

let show = { transformed: true, preserved: true };

    // The elliptic package.json is only used for its version
    var ellipticPackage = require('elliptic/package.json');
    ellipticPackage = JSON.stringify({ version: ellipticPackage.version });

    var version = require('../package.json').version;

    var undef = "module.exports = undefined;";
    var empty = "module.exports = {};";

    // This is only used in getKeyPair, which we do not use; but we'll
    // leave it in tact using the browser crypto functions
    var brorand = "module.exports = function(length) { var result = new Uint8Array(length); (global.crypto || global.msCrypto).getRandomValues(result); return result; }";

    // setImmediate is installed globally by our src.browser/shims.ts, loaded from src.ts/index.ts
    var process = "module.exports = { browser: true };";
    var timers = "module.exports = { setImmediate: global.setImmediate }; ";

    function readShim(filename) {
        return fs.readFileSync('./shims/' + filename + '.js').toString();