Generating unique random long alphanumeric IDs using golang

281 views
Skip to first unread message

Sankar

unread,
Feb 12, 2016, 11:45:47 AM2/12/16
to golang-nuts
Hi

Are there any libraries by Google (or others), tested in production that generates, unique, random, long (fixed length preferably), alphanumeric strings ?

I could write a UUID generator library myself, but would like to rely on a stable, actively-maintained FOSS project with a corporate backing instead of reinventing the wheel.

Any pointers ?

Thanks

Sankar

John McKown

unread,
Feb 12, 2016, 11:52:22 AM2/12/16
to Sankar, golang-nuts
Perhaps?
libuuid is part of the util-linux package since version 2.15.1 and is available from 



https://gist.github.com/yoggy/4483031 (example C program using the above)

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
The man has the intellect of a lobotomized turtle.

Maranatha! <><
John McKown

Sankar P

unread,
Feb 12, 2016, 11:54:57 AM2/12/16
to John McKown, golang-nuts
Thanks.

But I was looking for a pure go solution.
--
Sankar P
http://psankar.blogspot.com

Paul Borman

unread,
Feb 12, 2016, 12:02:31 PM2/12/16
to Sankar P, John McKown, golang-nuts

Shawn Milochik

unread,
Feb 12, 2016, 12:12:17 PM2/12/16
to golang-nuts

I've been using this, and it's the simplest I've seen. Barely any code.

Sankar P

unread,
Feb 12, 2016, 12:35:24 PM2/12/16
to Sh...@milochik.com, golang-nuts
Thanks everyone. I will go with the docker
https://github.com/docker/distribution/tree/master/uuid package.

2016-02-12 22:41 GMT+05:30 Shawn Milochik <shawn...@gmail.com>:
> github.com/nathanwinther/go-uuid4
>
> I've been using this, and it's the simplest I've seen. Barely any code.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "golang-nuts" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/golang-nuts/uvPD2oY33j8/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
Sankar P
http://psankar.blogspot.com

Jason E. Aten

unread,
Feb 12, 2016, 1:10:35 PM2/12/16
to golang-nuts, Sh...@milochik.com
I define 6 different types of "Really Unique Identifiers" in my RUID package, depending on the specifics of what you need.

https://github.com/glycerine/ruid

Reply all
Reply to author
Forward
0 new messages