Crypto Edge
    Preparing search index...

    Function installPolyfills

    • Install polyfills for missing global APIs.

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

      Never installs a crypto.getRandomValues fallback: a non-cryptographic generator would silently weaken every library in the realm that draws randomness from it.

      Returns { textEncoder: boolean; textDecoder: boolean; btoa: boolean; atob: 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.

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

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