@me2em/crypto
    Preparing search index...

    Function randomBytesB64

    • Generates cryptographically random bytes and returns them as a standard Base64 string.

      Useful for generating salts and nonces that need to be transmitted or stored as strings.

      Parameters

      • length: number

        Number of random bytes to generate.

      Returns string

      Base64-encoded random bytes.

      const salt = randomBytesB64(16);