Update README.md

This commit is contained in:
2021-06-17 03:07:30 +02:00
parent 52a5737806
commit a072a86436

View File

@@ -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";
``` ```