base64EncodeUrlSafe

Encode data as URl-safe Base64

We need url safe base64 encoding and openssl only gives us regular base64, so we convert it here. Also trim trailing '=' from data (see RFC).

The following replacements are done: * '+' is converted to '-' * '/' is converted to '_' * '=' terminates the output at this point, stripping all '=' chars

  1. char[] base64EncodeUrlSafe(T t)
    char[]
    base64EncodeUrlSafe
    (
    T
    )
    (
    T t
    )
    if (
    is(T : string) ||
    is(T : char[])
    ||
    is(T : ubyte[])
    )
  2. char[] base64EncodeUrlSafe(BIGNUM* bn)

Return Value

Type: char[]

An array of chars with the base64 encoded data.

Meta