@trashpanda001/helpers
    Preparing search index...

    Function encode64

    • Encodes a string into a base-64 encoded string.

      Parameters

      • string: string

        the string to encode

      • padding: boolean = false

        whether to add padding characters (=) to the end of the string (default: false)

      Returns string

      the base-64 encoded string

      import { encode64 } from "@trashpanda001/helpers/string"

      encode64("a")
      // "YQ"
      encode64("a", true)
      // "YQ=="