Stone.js API
    Preparing search index...
    • Base64-encode a string, wherever the code is running.

      Node and a browser disagree on how to do this, and the browser's btoa only accepts latin1, so a non-latin path or a payload with an accent throws. Encoding to UTF-8 bytes first makes both agree on the same output, which matters because the two halves of a hydrated render can happen on different sides of that divide and have to produce the same key.

      Parameters

      • value: string

        The string to encode.

      Returns string

      The base64 form.