Update README.md
This commit is contained in:
24
README.md
24
README.md
@@ -20,28 +20,28 @@ using VAR.UrlCompressor;
|
|||||||
Compress an URL with:
|
Compress an URL with:
|
||||||
|
|
||||||
```csharp
|
```csharp
|
||||||
string compressedUrl = UrlCompressor.Compress("https:\\google.com");
|
string compressedUrl = UrlCompressor.Compress("https:\\google.com");
|
||||||
// compressedUrl = "Hk30TGDxt8jOOW6"
|
// compressedUrl = "Hk30TGDxt8jOOW6"
|
||||||
```
|
```
|
||||||
|
|
||||||
Decompress an URL with:
|
Decompress an URL with:
|
||||||
|
|
||||||
```csharp
|
```csharp
|
||||||
string decompressedUrl = UrlCompressor.Decompress("Hk30TGDxt8jOOW6");
|
string decompressedUrl = UrlCompressor.Decompress("Hk30TGDxt8jOOW6");
|
||||||
// decompressedUrl = "https:\\google.com";
|
// decompressedUrl = "https:\\google.com";
|
||||||
```
|
```
|
||||||
|
|
||||||
For extra compression use host conversions. For example:
|
For extra compression use host conversions. For example:
|
||||||
|
|
||||||
```csharp
|
```csharp
|
||||||
Dictionary<string, string> hostConversions = new Dictionary<string, string> {
|
Dictionary<string, string> hostConversions = new Dictionary<string, string> {
|
||||||
{ "google", "G" }
|
{ "google", "G" }
|
||||||
{ "com", "C" }
|
{ "com", "C" }
|
||||||
}
|
}
|
||||||
string compressedUrl = UrlCompressor.Compress("https:\\google.com", );
|
string compressedUrl = UrlCompressor.Compress("https:\\google.com", );
|
||||||
// compressedUrl = "oMyuFVR41"
|
// compressedUrl = "oMyuFVR41"
|
||||||
string decompressedUrl = UrlCompressor.Decompress("oMyuFVR41");
|
string decompressedUrl = UrlCompressor.Decompress("oMyuFVR41");
|
||||||
// decompressedUrl = "https:\\google.com";
|
// decompressedUrl = "https:\\google.com";
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user