Class ELink
Represents an Electronic Link which is an alpha-encoded identifier along with metadata information.
Warning! This class MAY generate fragments of profanity, however any ID can be regenerated using a different seed passed to Encode(seed)
Inheritance
System.Object
ELink
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Azos.dll
Syntax
public sealed class ELink
Constructors
ELink(GDID, Byte[])
Create ELink instance from GDID (with era).
Declaration
public ELink(GDID gdid, byte[] metadata = null)
Parameters
Type |
Name |
Description |
GDID |
gdid |
|
System.Byte[] |
metadata |
|
ELink(String)
Declaration
public ELink(string link)
Parameters
Type |
Name |
Description |
System.String |
link |
|
ELink(UInt64, Byte[])
Creates an Elink instance initialized with GDID of 0 Era having its ID set to ulong value
Declaration
public ELink(ulong id, byte[] metadata)
Parameters
Type |
Name |
Description |
System.UInt64 |
id |
|
System.Byte[] |
metadata |
|
Fields
ALPHABET
Declaration
public static readonly string[] ALPHABET
Field Value
Type |
Description |
System.String[] |
|
MAX_LINK_CHAR_SIZE
Declaration
public const int MAX_LINK_CHAR_SIZE = 1024
Field Value
Type |
Description |
System.Int32 |
|
RALPHABET
Declaration
public static readonly Dictionary<string, int> RALPHABET
Field Value
Type |
Description |
System.Collections.Generic.Dictionary<System.String, System.Int32> |
|
VARIATIONS
Represents how many variations every link has (seeds)
Declaration
public const int VARIATIONS = 15
Field Value
Type |
Description |
System.Int32 |
|
Properties
AsGDIDSymbol
Declaration
public GDIDSymbol AsGDIDSymbol { get; }
Property Value
GDID
Returns the GDID that this link represents
Declaration
public GDID GDID { get; }
Property Value
ID
Returns the ID portion of GDID represented by this instance
Declaration
Property Value
Type |
Description |
System.UInt64 |
|
Link
Returns a link encoded as a string using whatever randomization seed was passed to the last Encode(seed) call.
If Encode() was not called, then the link will get encoded using system rnd for a seed value
Declaration
public string Link { get; }
Property Value
Type |
Description |
System.String |
|
Returns metadata attached to this instance, or null if there is no metadata specified
Declaration
public byte[] Metadata { get; }
Property Value
Type |
Description |
System.Byte[] |
|
Methods
Encode(Nullable<Byte>)
Encodes a link into a textual form, using the supplied randomization seed, otherwise the system rnd is used.
A seed has 4 effective bits, yielding 16 possible variations for every link
Declaration
public string Encode(byte? seed = default(byte? ))
Parameters
Type |
Name |
Description |
System.Nullable<System.Byte> |
seed |
|
Returns
Type |
Description |
System.String |
|
Extension Methods