niklr / crypto-browserify

partial implementation of node's `crypto` for the browser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

crypto-browserify

Source: https://github.com/crypto-browserify/crypto-browserify

The bundled version has been created based on https://github.com/crypto-browserify/crypto-browserify/issues/166

  1. npm install -g browserify
  2. npm install --save crypto-browserify
  3. create main.js with content:
var cryptoBrowserify = require('crypto');
// Node.js-style export for Node and Component
if (typeof module != 'undefined') {
    // left here for backwards compatibility
    module.exports = cryptoBrowserify;
    module.exports.cryptoBrowserify = cryptoBrowserify;
} else if (typeof define === "function" && define.amd) {
    // AMD/requirejs: Define the module
    define(function () {
        return cryptoBrowserify;
    });
} else {
    // Browser: Expose to window
    window.cryptoBrowserify = cryptoBrowserify;
}
  1. browserify -s cryptoBrowserify main.js -o crypto-browserify.js

Switch to your project

  1. npm install --save github:niklr/crypto-browserify
  2. import * as cryptoBrowserify from 'crypto-browserify';

About

partial implementation of node's `crypto` for the browser

License:MIT License


Languages

Language:JavaScript 100.0%