Git Product home page Git Product logo

tinyurl's Introduction

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

nuget NETCore stats MIT

Description

Language: English | 中文

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

Install-Package TinyURL

2、Install the persistence library

Install-Package TinyURL.SqlServer

3、Short code

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

tinyurl's People

Contributors

hueifeng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tinyurl's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.