Crypto Edge
    Preparing search index...

    Function installPolyfills

    • Install polyfills for missing global APIs.

      Safe to call multiple times -- subsequent calls are no-ops.

      Returns {
          textEncoder: boolean;
          textDecoder: boolean;
          btoa: boolean;
          atob: boolean;
          getRandomValues: boolean;
      }

      An object describing which polyfills were installed.

      • textEncoder: boolean

        Whether the TextEncoder polyfill was installed.

      • textDecoder: boolean

        Whether the TextDecoder polyfill was installed.

      • btoa: boolean

        Whether the btoa polyfill was installed.

      • atob: boolean

        Whether the atob polyfill was installed.

      • getRandomValues: boolean

        Whether the insecure crypto.getRandomValues polyfill was installed.

      import { installPolyfills } from "@sebastienrousseau/crypto-edge";

      const installed = installPolyfills();
      console.log(installed.textEncoder); // true if polyfill was needed