{"size": 1189, "ext": "js", "max_stars_repo_path": "sea/shim.js", "max_stars_repo_name": "richardanaya/gun", "max_stars_repo_stars_event_min_datetime": "2017-04-10T16:19:36.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-27T02:03:37.000Z", "max_issues_repo_path": "sea/shim.js", "max_issues_repo_name": "richardanaya/gun", "max_issues_repo_issues_event_min_datetime": "2017-04-16T11:49:15.000Z", "max_issues_repo_issues_event_max_datetime": "2019-10-29T18:52:29.000Z", "max_forks_repo_path": "sea/shim.js", "max_forks_repo_name": "richardanaya/gun", "max_forks_repo_forks_event_min_datetime": "2017-04-13T23:50:42.000Z", "max_forks_repo_forks_event_max_datetime": "2021-04-28T16:29:27.000Z"}
{"max_stars_count": 27, "max_issues_count": 5, "max_forks_count": 7, "avg_line_length": 32.1351351351, "max_line_length": 127, "alphanum_fraction": 0.6038687973}

    const SEA = require('./root')
    const Buffer = require('./buffer')
    const api = {Buffer: Buffer}
    var o = {};

    if(SEA.window){
      api.crypto = window.crypto || window.msCrypto
      api.subtle = (api.crypto||o).subtle || (api.crypto||o).webkitSubtle;
      api.TextEncoder = window.TextEncoder;
      api.TextDecoder = window.TextDecoder;
      api.random = (len) => Buffer.from(api.crypto.getRandomValues(new Uint8Array(Buffer.alloc(len))));
    }
    if(!api.TextDecoder)
    {
      const { TextEncoder, TextDecoder } = require('text-encoding');
      api.TextDecoder = TextDecoder;
      api.TextEncoder = TextEncoder;
    }
    if(!api.crypto)
    {
      try
      {
      var crypto = require('crypto', 1);
      Object.assign(api, {
        crypto,
        random: (len) => Buffer.from(crypto.randomBytes(len))
      });      
      const { Crypto: WebCrypto } = require('@peculiar/webcrypto', 1);
      api.ossl = api.subtle = new WebCrypto({directory: 'ossl'}).subtle // ECDH
    }
    catch(e){
      console.log("text-encoding and peculiar/nwebcrypto may not be included by default, please add it to your package.json!");
    }}

    module.exports = api
  