Coder Social home page Coder Social logo

Build Status Go Report Card GoDoc Go Version Code Size Repo License Release


Logo

Nanorand

Nanosecond pseudo-random generator
View Demo ยท Report Bug ยท Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contributing
  5. License
  6. Contact

About The Project

Nanorand Screen Shot

There are many great ways to generate "cryptographical-properly" 6-digit codes in Go; however, I didn't find one that really suited my needs. So I created this simplest one. I created a ONE line of code and few functions for creating array and long digit, for example: 127 length. It's so amazing. That be the best for you as soon as you try it -- I think this is it.

Here's why:

  • Your time should be focused on creating something amazing. A function GenerateShort for digit up to length of 7 is the faster than other ways, because it use nanosecond of time on your machine.
  • You shouldn't be doing google "How to generate 6-digit number" again and again. Just try it and you would love.
  • You should implement DRY principles to the rest of your life ๐Ÿ˜„

Of course, this project don't suite your purposes if you are creating Pentagon security system. In other way it works great. Use following instruction to install and use it.

(back to top)

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

Installation

 go get github.com/nanorand/nanorand

for other version

 go get github.com/nanorand/[email protected]

replace X for number of version. For example: v0.1.1

(back to top)

Usage

package main

import (
	"fmt"
	"github.com/nanorand/nanorand"
)

func main() {
	fmt.Println("6 digit code")

	code, err := nanorand.Gen(6)
	if err != nil {
		return
	}

	fmt.Println(code)
}

output:

798785

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Kirill Bogomolov - @manazoid - [email protected]

Project Link: https://github.com/nanorand/nanorand

(back to top)

NanoRand's Projects

nanorand icon nanorand

Generate 6-digit numbers and so on with golang module NanoRand

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.