Giter Site home page Giter Site logo

shortid's People

Contributors

asellappen avatar chenlujjj avatar shawntoffel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shortid's Issues

use base58 alphabet

Does it possible to use only base58 default chars? I wan to avoid symbols that looks identically and also have double click - copy/paste friendly string

worker id problem

when I deploy my application in a docker cluster (k8s or docker-compose), I have no method to assign a worker id for different container, I can only get an docker container ID in my app by $HOSTNAME.I want to know what is the best practice to use the lib or generate an shortid by myself?

Returning an error

First of all really good job creating this library! Coming from Node.js I was searching for a shortid alternative a year ago, you finally created it!

When can I expect this library to return an error?
Could this happen randomly, should I panic at this point? Or will this only happen during the first Generate() call?

I'm asking because my current ID generation module does not return an error and I'd prefer to keep my code this way.

Is it Distributed safe?

Hi, thanks for this awesome library. My question is can it be use in a distributed environment?

Question: Is that safe to remove symbols from DefaultABC?

Is that safe to remove symbols from DefaultABC?
Basically, use the string "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" instead.
I am using it to generate shorten URL and do not wish to see symbols from the URL.
Thanks a lot for your project.

Edited:

Sorry that I didn't try it before asking this question. I tried to remove those two symbols and return error message panic: alphabet must contain 64 unique characters. I think that means I can NOT remove symbols. It will be nice I can remove symbols from URL. The id does not have to be 100% unique. I will check the id existence before insert and re-generate if it exists.

Add support for Gomodules

Even though this library doesn't use any external dependencies, it's annoying that it doesn't have a go.mod file.

Is it possible to add it?

index out of range

Hey Guys, I have a gin project actualy using this library, but sometimes send a panic error when generate a new SortID.

This is the error:
captura de pantalla de 2017-03-25 21-19-53

An this is my generation code:

sid, _ := shortid.New(1, shortid.DefaultABC, 2342)
ssid,e1 := sid.Generate()

What is the reason of this error?

Possible to mock?

Is it possible to mock shortids?

The key feature of shortid is to guarantee its uniqueness, however for testing purpose, is it possible to return a fixed series each time I run my tests? thx.

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.