Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/hueifeng/tinyurl
- Owner: hueifeng
- License: mit
- Created: 2020-12-29T08:12:31.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-07-09T15:01:15.000Z (over 2 years ago)
- Last Synced: 2023-03-03T08:55:04.852Z (almost 2 years ago)
- Topics: dotnet, shorturl, tinyurl, url
- Language: C#
- Homepage:
- Size: 191 KB
- Stars: 7
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## 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)