wordGenerator

package module
v0.0.0-...-1f13e79 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2016 License: MIT Imports: 2 Imported by: 4

README

Build Status GoDoc #Word Generator It is just an implementation for generating randomized character, word and words. The goal of creating such project is that I need generate a lot of random hash key in order to test the correctness of anohter project that I am working on.

Using

import

import "github.com/zhexuany/wordGenerator"

API

func foo() {
    ch := wordGenerator.GetChar()
    // 5 is the length of word
    str := wordGenerator.GetWord(5)
    // 5 is the number of word, 20 is the maximum length of word
    strs := wordGenerator.GetWords(5, 20)
}

Dependency

This project is built and tested under Go 1.7. Other Go version may not supported yet. Other than GO itself, this project does not have any deoendency.

Future work

  • support Non-ascii such Chinese and Japanese

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetChar

func GetChar() string

GetChar will return a single character from Alphabets

func GetWord

func GetWord(length int) string

GetWord will return a word whose length is defined by parameter

func GetWords

func GetWords(num int, maxLen int) []string

GetWords will return a slice of string.

Types

type WordGenerator

type WordGenerator struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL