'use strict' exports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = require('randombytes') exports.createHash = exports.Hash = require('create-hash') exports.createHmac = exports.Hmac = require('create-hmac') var hashes = ['sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'md5', 'rmd160'].concat(Object.keys(require('browserify-sign/algos'))) exports.getHashes = function () { return hashes } var p = require('pbkdf2') exports.pbkdf2 = p.pbkdf2 exports.pbkdf2Sync = p.pbkdf2Sync var aes = require('browserify-cipher') ;[ 'Cipher', 'createCipher', 'Cipheriv', 'createCipheriv', 'Decipher', 'createDecipher', 'Decipheriv', 'createDecipheriv', 'getCiphers', 'listCiphers' ].forEach(function (key) { exports[key] = aes[key] }) var dh = require('diffie-hellman') ;[ 'DiffieHellmanGroup', 'createDiffieHellmanGroup', 'getDiffieHellman', 'createDiffieHellman', 'DiffieHellman' ].forEach(function (key) { exports[key] = dh[key] }) var sign = require('browserify-sign') ;[ 'createSign', 'Sign', 'createVerify', 'Verify' ].forEach(function (key) { exports[key] = sign[key] }) exports.createECDH = require('create-ecdh') var publicEncrypt = require('public-encrypt') ;[ 'publicEncrypt', 'privateEncrypt', 'publicDecrypt', 'privateDecrypt' ].forEach(function (key) { exports[key] = publicEncrypt[key] }) // the least I can do is make error messages for the rest of the node.js/crypto api. ;[ 'createCredentials' ].forEach(function (name) { exports[name] = function () { throw new Error([ 'sorry, ' + name + ' is not implemented yet', 'we accept pull requests', 'https://github.com/crypto-browserify/crypto-browserify' ].join('\n')) } })
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 19553 | swellard | Move and rename clients | ||
//guest/perforce_software/helix-web-services/main/source/clients/2016.1.0/javascript/node_modules/crypto-browserify/index.js | |||||
#1 | 18810 | tjuricek |
First-pass at JavaScript client SDK. JavaScript requires Node with Gulp to "browserfy" the library. It's the easiest way I found to use the swagger-js project; bundle up a wrapping method. There is no JavaScript reference guide. The swagger-js doesn't really document what they do very well, actually. Overall I'm not particularly impressed by swagger-js, it was hard to even figure out what the right method syntax was. We may want to invest time in doing it better. This required setting CORS response headers, which are currently defaulted to a fairly insecure setting. |