<commit_before>![](logo.png)  
![](https://img.shields.io/badge/version-1.2.0-blue.svg)
![](https://img.shields.io/badge/LICENSE-AGPL-blue.svg)
[![Build Status](https://travis-ci.org/andyxning/shortme.svg?branch=master)](https://travis-ci.org/andyxning/shortme)
### Introduction
----
ShortMe is a url shortening service written in Golang.  
It is with high performance and scalable.  
ShortMe is ready to be used in production. Have fun with it. :)

### Features
----
* Convert same long urls to different short urls.
* Api support
* Short url black list
    * To avoid some words, like `f**k` and `stupid`
    * To make sure that apis such as `/version` and `/health` will only be
    used as api not short urls or otherwise when requesting `http://127.0.0
    .1:3030/version`, version info will be returned rather the long url
    corresponding to the short url "version".
* Base string config in configuration file
    * **Once this base string is specified, it can not be reconfigured anymore
    otherwise the shortened urls may not be unique and thus may conflict with
     previous ones.**
* Avoid short url loop
    * In case we request the short url for an already shortened url by
    **shortme**. This is meaningless and will consume more resource in
    **shortme**.
* Short **http** or **https** urls

### Implementation
----
Currently, afaik, there are three ways to implement short url service.
* Hash
    * This way is straightforward. However, every hash function will have a
    collision when data is large.
* Sample
    * this way may contain collision, too. See example below (This example,
    in Python, is only used to demonstrate the collision situation.).

    ```python<commit_msg>update readme with web feature<commit_after>![](logo.png)  
![](https://img.shields.io/badge/version-1.2.0-blue.svg)
![](https://img.shields.io/badge/LICENSE-AGPL-blue.svg)
[![Build Status](https://travis-ci.org/andyxning/shortme.svg?branch=master)](https://travis-ci.org/andyxning/shortme)
### Introduction
----
ShortMe is a url shortening service written in Golang.  
It is with high performance and scalable.  
ShortMe is ready to be used in production. Have fun with it. :)

### Features
----
* Convert same long urls to different short urls.
* Api support
* Web support
* Short url black list
    * To avoid some words, like `f**k` and `stupid`
    * To make sure that apis such as `/version` and `/health` will only be
    used as api not short urls or otherwise when requesting `http://127.0.0
    .1:3030/version`, version info will be returned rather the long url
    corresponding to the short url "version".
* Base string config in configuration file
    * **Once this base string is specified, it can not be reconfigured anymore
    otherwise the shortened urls may not be unique and thus may conflict with
     previous ones.**
* Avoid short url loop
    * In case we request the short url for an already shortened url by
    **shortme**. This is meaningless and will consume more resource in
    **shortme**.
* Short **http** or **https** urls

### Implementation
----
Currently, afaik, there are three ways to implement short url service.
* Hash
    * This way is straightforward. However, every hash function will have a
    collision when data is large.
* Sample
    * this way may contain collision, too. See example below (This example,
    in Python, is only used to demonstrate the collision situation.).

    ```python
{'fraction_non_alphanumeric': 0.10292838503914178, 'fraction_numerical': 0.007538416932444187, 'mean_word_length': 3.5157068062827226, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '431882', 'n_tokens_mistral': 986, 'n_tokens_neox': 949, 'n_words': 435}