Show / Hide Table of Contents

Class Base64Url

A codec for Base-64 URL (RFC 4648).

Inheritance
Object
Base64Url
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Ipfs
Assembly: Ipfs.Core.dll
Syntax
public static class Base64Url
Remarks

A codec for Base-64 URL, Encode(Byte[]) and Decode(String). Adds the extension method ToBase64Url(Byte[]) to encode a byte array and FromBase64Url(String) to decode a Base-64 URL string.

The original code was found at https://brockallen.com/2014/10/17/base64url-encoding/.

Methods

| Improve this Doc View Source

Decode(String)

Converts the specified String, which encodes binary data as base 64 URL digits, to an equivalent 8-bit unsigned integer array.

Declaration
public static byte[] Decode(string s)
Parameters
Type Name Description
String s

The base 64 string to convert.

Returns
Type Description
Byte[]

An array of 8-bit unsigned integers that is equivalent to s.

| Improve this Doc View Source

Encode(Byte[])

Converts an array of 8-bit unsigned integers to its equivalent string representation that is encoded with base-64 URL characters.

Declaration
public static string Encode(byte[] bytes)
Parameters
Type Name Description
Byte[] bytes

An array of 8-bit unsigned integers.

Returns
Type Description
String

The string representation, in base 64, of the contents of bytes.

| Improve this Doc View Source

FromBase64Url(String)

Converts the specified String, which encodes binary data as base 64 url digits, to an equivalent 8-bit unsigned integer array.

Declaration
public static byte[] FromBase64Url(this string s)
Parameters
Type Name Description
String s

The base 64 string to convert.

Returns
Type Description
Byte[]

An array of 8-bit unsigned integers that is equivalent to s.

| Improve this Doc View Source

ToBase64Url(Byte[])

Converts an array of 8-bit unsigned integers to its equivalent string representation that is encoded with base-64 URL digits.

Declaration
public static string ToBase64Url(this byte[] bytes)
Parameters
Type Name Description
Byte[] bytes

An array of 8-bit unsigned integers.

Returns
Type Description
String

The string representation, in base 64, of the contents of bytes.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX