Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hueifeng/tinyurl

Generic shortcode URL implementation in CSharp.
https://github.com/hueifeng/tinyurl

dotnet shorturl tinyurl url

Last synced: 3 months ago
JSON representation

Generic shortcode URL implementation in CSharp.

Awesome Lists containing this project

README

        





A simple, stable, safe, and fast short-chain generation library.


















## Description

Language: English | [中文](README.zh-cn.md)

The shortcode is composed of 62 characters of `[a-z, A-Z, 0-9]`, the length of the shortcode is 6 digits, and the 6-digit shortcode supports 56.8 billion combinations: (26+26+10)^6 =568002355884.

## Features

- Flexible reference library, easy to use
- Persistent storage of original data
- Self-increasing ID and MurmurHash algorithm are adopted to ensure the safety and reliability of shortcode without collision

## Quick Start

1、Install Package

```powershell
Install-Package TinyURL
```

2、Install the persistence library

```powershell
Install-Package TinyURL.SqlServer
```

3、Short code

```csharp
TinyURL shortUrl = new TinyURL(
new SqlServerStorageProcessor("Server=localhost;Database=TestDb;Trusted_Connection=True;"));
await shortUrl.Generator(url);
```

## Table Structure




Table
UrlDictionary


Name
Type
Details




Id
[int] IDENTITY(1,1) NOT NULL
identity ID


Code
[nvarchar] (6)
short code


URL
[nvarchar] (128)
Original link


HashVal
[nvarchar] (32)
Hash Value


InsertAt
[datetime]
Creation time


## Contribution

If you have any ideas you can join in, or find that there is code in this project that needs improvement, welcome to Fork and submit a PR!

## License

[MIT](LICENSE)