{"id":27880847,"url":"https://github.com/atomicgo/random","last_synced_at":"2025-05-05T04:38:32.774Z","repository":{"id":175116769,"uuid":"653368487","full_name":"atomicgo/random","owner":"atomicgo","description":"🎲 Minimalistic random generator for numbers, strings, booleans, etc.","archived":false,"fork":false,"pushed_at":"2024-08-08T17:04:31.000Z","size":56,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T11:39:47.354Z","etag":null,"topics":["atomicgo","go","golang","golang-library","random","utils"],"latest_commit_sha":null,"homepage":"https://atomicgo.dev","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atomicgo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["MarvinJWendt"]}},"created_at":"2023-06-13T23:36:16.000Z","updated_at":"2024-08-08T17:04:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"edd65759-326a-425c-9ee1-98c6b5a26051","html_url":"https://github.com/atomicgo/random","commit_stats":null,"previous_names":["atomicgo/random"],"tags_count":1,"template":false,"template_full_name":"atomicgo/template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicgo%2Frandom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicgo%2Frandom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicgo%2Frandom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicgo%2Frandom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atomicgo","download_url":"https://codeload.github.com/atomicgo/random/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252442480,"owners_count":21748448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["atomicgo","go","golang","golang-library","random","utils"],"created_at":"2025-05-05T04:38:32.204Z","updated_at":"2025-05-05T04:38:32.766Z","avatar_url":"https://github.com/atomicgo.png","language":"Go","funding_links":["https://github.com/sponsors/MarvinJWendt"],"categories":[],"sub_categories":[],"readme":"\u003c!--\n\n\n\n┌───────────────────────────────────────────────────────────────────┐\n│                                                                   │\n│                          IMPORTANT NOTE                           │\n│                                                                   │\n│               This file is automatically generated                │\n│           All manual modifications will be overwritten            │\n│                                                                   │\n└───────────────────────────────────────────────────────────────────┘\n\n\n\n--\u003e\n\n\u003ch1 align=\"center\"\u003eAtomicGo | random\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://img.shields.io/endpoint?url=https%3A%2F%2Fatomicgo.dev%2Fapi%2Fshields%2Frandom\u0026style=flat-square\" alt=\"Downloads\"\u003e\n\n\u003ca href=\"https://github.com/atomicgo/random/releases\"\u003e\n\u003cimg src=\"https://img.shields.io/github/v/release/atomicgo/random?style=flat-square\" alt=\"Latest Release\"\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://codecov.io/gh/atomicgo/random\" target=\"_blank\"\u003e\n\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/atomicgo/random/go.yml?style=flat-square\" alt=\"Tests\"\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://codecov.io/gh/atomicgo/random\" target=\"_blank\"\u003e\n\u003cimg src=\"https://img.shields.io/codecov/c/gh/atomicgo/random?color=magenta\u0026logo=codecov\u0026style=flat-square\" alt=\"Coverage\"\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://codecov.io/gh/atomicgo/random\"\u003e\n\u003c!-- unittestcount:start --\u003e\u003cimg src=\"https://img.shields.io/badge/Unit_Tests-60-magenta?style=flat-square\" alt=\"Unit test count\"\u003e\u003c!-- unittestcount:end --\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://opensource.org/licenses/MIT\" target=\"_blank\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square\" alt=\"License: MIT\"\u003e\n\u003c/a\u003e\n  \n\u003ca href=\"https://goreportcard.com/report/github.com/atomicgo/random\" target=\"_blank\"\u003e\n\u003cimg src=\"https://goreportcard.com/badge/github.com/atomicgo/random?style=flat-square\" alt=\"Go report\"\u003e\n\u003c/a\u003e   \n\n\u003c/p\u003e\n\n---\n\n\u003cp align=\"center\"\u003e\n\u003cstrong\u003e\u003ca href=\"https://pkg.go.dev/atomicgo.dev/random#section-documentation\" target=\"_blank\"\u003eDocumentation\u003c/a\u003e\u003c/strong\u003e\n|\n\u003cstrong\u003e\u003ca href=\"https://github.com/atomicgo/atomicgo/blob/main/CONTRIBUTING.md\" target=\"_blank\"\u003eContributing\u003c/a\u003e\u003c/strong\u003e\n|\n\u003cstrong\u003e\u003ca href=\"https://github.com/atomicgo/atomicgo/blob/main/CODE_OF_CONDUCT.md\" target=\"_blank\"\u003eCode of Conduct\u003c/a\u003e\u003c/strong\u003e\n\u003c/p\u003e\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/atomicgo/atomicgo/main/assets/header.png\" alt=\"AtomicGo\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ctable\u003e\n\u003ctbody\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/p\u003e\n\u003ch3  align=\"center\"\u003e\u003cpre\u003ego get atomicgo.dev/random\u003c/pre\u003e\u003c/h3\u003e\n\u003cp align=\"center\"\u003e\n\u003ctable\u003e\n\u003ctbody\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/p\u003e\n\n\u003c!-- gomarkdoc:embed:start --\u003e\n\n\u003c!-- Code generated by gomarkdoc. DO NOT EDIT --\u003e\n\n# random\n\n```go\nimport \"atomicgo.dev/random\"\n```\n\nPackage random provides random generators for most inbuilt types \\(int, float, string, bool, etc...\\).\n\nAll functions are easily accessible and don't require any setup.\n\n## Index\n\n- [Constants](\u003c#constants\u003e)\n- [func Bool\\(\\) bool](\u003c#Bool\u003e)\n- [func BoolSlice\\(count int\\) \\[\\]bool](\u003c#BoolSlice\u003e)\n- [func Entries\\[T any\\]\\(s \\[\\]T, n int\\) \\[\\]T](\u003c#Entries\u003e)\n- [func EntriesUnique\\[T any\\]\\(s \\[\\]T, n int\\) \\[\\]T](\u003c#EntriesUnique\u003e)\n- [func Entry\\[T any\\]\\(s \\[\\]T\\) T](\u003c#Entry\u003e)\n- [func Float32\\(min, max float32\\) float32](\u003c#Float32\u003e)\n- [func Float32Slice\\(min, max float32, count int\\) \\[\\]float32](\u003c#Float32Slice\u003e)\n- [func Float32SliceUnique\\(min, max float32, count int\\) \\[\\]float32](\u003c#Float32SliceUnique\u003e)\n- [func Float64\\(min, max float64\\) float64](\u003c#Float64\u003e)\n- [func Float64Slice\\(min, max float64, count int\\) \\[\\]float64](\u003c#Float64Slice\u003e)\n- [func Float64SliceUnique\\(min, max float64, count int\\) \\[\\]float64](\u003c#Float64SliceUnique\u003e)\n- [func Int\\(min, max int\\) int](\u003c#Int\u003e)\n- [func Int16\\(min, max int16\\) int16](\u003c#Int16\u003e)\n- [func Int16Slice\\(min, max, count int16\\) \\[\\]int16](\u003c#Int16Slice\u003e)\n- [func Int16SliceUnique\\(min, max int16, count int\\) \\[\\]int16](\u003c#Int16SliceUnique\u003e)\n- [func Int32\\(min, max int32\\) int32](\u003c#Int32\u003e)\n- [func Int32Slice\\(min, max, count int32\\) \\[\\]int32](\u003c#Int32Slice\u003e)\n- [func Int32SliceUnique\\(min, max int32, count int\\) \\[\\]int32](\u003c#Int32SliceUnique\u003e)\n- [func Int64\\(min, max int64\\) int64](\u003c#Int64\u003e)\n- [func Int64Slice\\(min, max, count int64\\) \\[\\]int64](\u003c#Int64Slice\u003e)\n- [func Int64SliceUnique\\(min, max int64, count int\\) \\[\\]int64](\u003c#Int64SliceUnique\u003e)\n- [func Int8\\(min, max int8\\) int8](\u003c#Int8\u003e)\n- [func Int8Slice\\(min, max, count int8\\) \\[\\]int8](\u003c#Int8Slice\u003e)\n- [func Int8SliceUnique\\(min, max int8, count int\\) \\[\\]int8](\u003c#Int8SliceUnique\u003e)\n- [func IntSlice\\(min, max, count int\\) \\[\\]int](\u003c#IntSlice\u003e)\n- [func IntSliceUnique\\(min, max, count int\\) \\[\\]int](\u003c#IntSliceUnique\u003e)\n- [func Probability\\(p float64\\) bool](\u003c#Probability\u003e)\n- [func Seed\\(seed int64\\)](\u003c#Seed\u003e)\n- [func Shuffle\\[T any\\]\\(s \\[\\]T\\) \\[\\]T](\u003c#Shuffle\u003e)\n- [func String\\(l int, set string\\) string](\u003c#String\u003e)\n- [func StringSlice\\(l int, set string, count int\\) \\[\\]string](\u003c#StringSlice\u003e)\n- [func Uint\\(min, max uint\\) uint](\u003c#Uint\u003e)\n- [func Uint16\\(min, max uint16\\) uint16](\u003c#Uint16\u003e)\n- [func Uint16Slice\\(min, max, count uint16\\) \\[\\]uint16](\u003c#Uint16Slice\u003e)\n- [func Uint16SliceUnique\\(min, max uint16, count int\\) \\[\\]uint16](\u003c#Uint16SliceUnique\u003e)\n- [func Uint32\\(min, max uint32\\) uint32](\u003c#Uint32\u003e)\n- [func Uint32Slice\\(min, max, count uint32\\) \\[\\]uint32](\u003c#Uint32Slice\u003e)\n- [func Uint32SliceUnique\\(min, max uint32, count int\\) \\[\\]uint32](\u003c#Uint32SliceUnique\u003e)\n- [func Uint64\\(min, max uint64\\) uint64](\u003c#Uint64\u003e)\n- [func Uint64Slice\\(min, max, count uint64\\) \\[\\]uint64](\u003c#Uint64Slice\u003e)\n- [func Uint64SliceUnique\\(min, max uint64, count int\\) \\[\\]uint64](\u003c#Uint64SliceUnique\u003e)\n- [func Uint8\\(min, max uint8\\) uint8](\u003c#Uint8\u003e)\n- [func Uint8Slice\\(min, max, count uint8\\) \\[\\]uint8](\u003c#Uint8Slice\u003e)\n- [func Uint8SliceUnique\\(min, max uint8, count int\\) \\[\\]uint8](\u003c#Uint8SliceUnique\u003e)\n- [func UintSlice\\(min, max, count uint\\) \\[\\]uint](\u003c#UintSlice\u003e)\n- [func UintSliceUnique\\(min, max uint, count int\\) \\[\\]uint](\u003c#UintSliceUnique\u003e)\n\n\n## Constants\n\n\u003ca name=\"StringSetLowercase\"\u003e\u003c/a\u003eStringSet constants are sets of characters that can be used in random strings.\n\n```go\nconst (\n    StringSetLowercase = \"abcdefghijklmnopqrstuvwxyz\"\n    StringSetUppercase = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n    StringSetNumbers   = \"0123456789\"\n    StringSetSymbols   = \"!\\\"#$%\u0026'()*+,-./:;\u003c=\u003e?@[\\\\]^_`{|}~\"\n    StringSetAll       = StringSetLowercase + StringSetUppercase + StringSetNumbers + StringSetSymbols\n)\n```\n\n\u003ca name=\"Bool\"\u003e\u003c/a\u003e\n## func [Bool](\u003chttps://github.com/atomicgo/random/blob/main/boolean.go#L4\u003e)\n\n```go\nfunc Bool() bool\n```\n\nBool returns a random boolean.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\tif random.Bool() {\n\t\tfmt.Println(\"Heads\")\n\t} else {\n\t\tfmt.Println(\"Tails\")\n\t}\n\n}\n```\n\n#### Output\n\n```\nHeads\n```\n\n\n\n\u003ca name=\"BoolSlice\"\u003e\u003c/a\u003e\n## func [BoolSlice](\u003chttps://github.com/atomicgo/random/blob/main/boolean.go#L10\u003e)\n\n```go\nfunc BoolSlice(count int) []bool\n```\n\nBoolSlice returns a slice of random booleans. If count is less than 0, BoolSlice will panic.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\ts := random.BoolSlice(5)\n\tfmt.Println(s)\n\n}\n```\n\n#### Output\n\n```\n[true true false false true]\n```\n\n\n\n\u003ca name=\"Entries\"\u003e\u003c/a\u003e\n## func [Entries](\u003chttps://github.com/atomicgo/random/blob/main/slice.go#L10\u003e)\n\n```go\nfunc Entries[T any](s []T, n int) []T\n```\n\nEntries returns a slice of n random elements from a slice. If n is less than 0, Entries will panic.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\ts := []int{1, 2, 3, 4, 5}\n\tfmt.Print(random.Entries(s, 3))\n\n}\n```\n\n#### Output\n\n```\n[4 4 5]\n```\n\n\n\n\u003ca name=\"EntriesUnique\"\u003e\u003c/a\u003e\n## func [EntriesUnique](\u003chttps://github.com/atomicgo/random/blob/main/slice.go#L26\u003e)\n\n```go\nfunc EntriesUnique[T any](s []T, n int) []T\n```\n\nEntriesUnique returns a slice of n unique random elements from a slice. If n is less than 0, EntriesUnique will panic. If n is greater than the length of s, EntriesUnique will panic.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\ts := []int{1, 2, 3, 4, 5}\n\tfmt.Print(random.EntriesUnique(s, 3))\n\n}\n```\n\n#### Output\n\n```\n[4 5 2]\n```\n\n\n\n\u003ca name=\"Entry\"\u003e\u003c/a\u003e\n## func [Entry](\u003chttps://github.com/atomicgo/random/blob/main/slice.go#L4\u003e)\n\n```go\nfunc Entry[T any](s []T) T\n```\n\nEntry returns a random element from a slice.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\ts := []int{1, 2, 3, 4, 5}\n\tfmt.Print(random.Entry(s))\n\n}\n```\n\n#### Output\n\n```\n4\n```\n\n\n\n\u003ca name=\"Float32\"\u003e\u003c/a\u003e\n## func [Float32](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L574\u003e)\n\n```go\nfunc Float32(min, max float32) float32\n```\n\nFloat32 returns a random float32 between min and max, inclusive. If min \\\u003e max, Float32 panics.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\tvar min, max float32 = 0, math.MaxFloat32\n\tres := random.Float32(min, max)\n\n\tfmt.Println(res)\n}\n```\n\n#### Output\n\n```\n0.6287385\n```\n\n\n\n\u003ca name=\"Float32Slice\"\u003e\u003c/a\u003e\n## func [Float32Slice](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L590\u003e)\n\n```go\nfunc Float32Slice(min, max float32, count int) []float32\n```\n\nFloat32Slice returns a slice of random float32s between min and max, inclusive. If min \\\u003e max, Float32Slice will panic. If count is less or euqal to 0, Float32SliceUnique will return an empty slice.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\ts := random.Float32Slice(1, 100, 10)\n\n\tfmt.Println(s)\n}\n```\n\n#### Output\n\n```\n[63.245113 34.879265 42.326313 96.07255 88.959915 66.83283 57.638523 84.8611 92.85987 97.56791]\n```\n\n\n\n\u003ca name=\"Float32SliceUnique\"\u003e\u003c/a\u003e\n## func [Float32SliceUnique](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L607\u003e)\n\n```go\nfunc Float32SliceUnique(min, max float32, count int) []float32\n```\n\nFloat32SliceUnique returns a slice of unique random float32s between min and max, inclusive. If min \\\u003e max, Float32SliceUnique will panic. If count is equal or less than 0, Float32SliceUnique will return an empty slice. If count is greater than the number of float32s between min and max, Float32SliceUnique will panic.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\ts := random.Float32SliceUnique(1, 100, 10)\n\n\tfmt.Println(s)\n}\n```\n\n#### Output\n\n```\n[63.245113 34.879265 42.326313 96.07255 88.959915 66.83283 57.638523 84.8611 92.85987 97.56791]\n```\n\n\n\n\u003ca name=\"Float64\"\u003e\u003c/a\u003e\n## func [Float64](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L633\u003e)\n\n```go\nfunc Float64(min, max float64) float64\n```\n\nFloat64 returns a random float64 between min and max, inclusive. If min \\\u003e max, Float64 panics.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\tvar min, max float64 = 0, math.MaxFloat64\n\tres := random.Float64(min, max)\n\n\tfmt.Println(res)\n}\n```\n\n#### Output\n\n```\n0.6287385421322026\n```\n\n\n\n\u003ca name=\"Float64Slice\"\u003e\u003c/a\u003e\n## func [Float64Slice](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L649\u003e)\n\n```go\nfunc Float64Slice(min, max float64, count int) []float64\n```\n\nFloat64Slice returns a slice of random float64s between min and max, inclusive. If min \\\u003e max, Float64Slice will panic. If count is less or euqal to 0, Float64SliceUnique will return an empty slice.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\ts := random.Float64Slice(1, 100, 10)\n\n\tfmt.Println(s)\n}\n```\n\n#### Output\n\n```\n[63.24511567108806 34.87926481692567 42.326312224687584 96.0725445866481 88.95991853003598 66.83282968657517 57.63852232585161 84.86109852327596 92.85987365256264 97.56790999047796]\n```\n\n\n\n\u003ca name=\"Float64SliceUnique\"\u003e\u003c/a\u003e\n## func [Float64SliceUnique](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L666\u003e)\n\n```go\nfunc Float64SliceUnique(min, max float64, count int) []float64\n```\n\nFloat64SliceUnique returns a slice of unique random float64s between min and max, inclusive. If min \\\u003e max, Float64SliceUnique will panic. If count is equal or less than 0, Float64SliceUnique will return an empty slice. If count is greater than the number of float64s between min and max, Float64SliceUnique will panic.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\ts := random.Float64SliceUnique(1, 100, 10)\n\n\tfmt.Println(s)\n}\n```\n\n#### Output\n\n```\n[63.24511567108806 34.87926481692567 42.326312224687584 96.0725445866481 88.95991853003598 66.83282968657517 57.63852232585161 84.86109852327596 92.85987365256264 97.56790999047796]\n```\n\n\n\n\u003ca name=\"Int\"\u003e\u003c/a\u003e\n## func [Int](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L7\u003e)\n\n```go\nfunc Int(min, max int) int\n```\n\nInt returns a random integer between min and max, inclusive. If min \\\u003e max, Int will panic.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\tmin, max := 0, math.MaxInt\n\tres := random.Int(min, max)\n\n\tfmt.Println(res)\n}\n```\n\n#### Output\n\n```\n5799089487994996006\n```\n\n\n\n\u003ca name=\"Int16\"\u003e\u003c/a\u003e\n## func [Int16](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L122\u003e)\n\n```go\nfunc Int16(min, max int16) int16\n```\n\nInt16 returns a random int16 between min and max, inclusive. If min \\\u003e max, Int16 panics.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\tvar min, max int16 = 0, math.MaxInt16\n\tres := random.Int16(min, max)\n\n\tfmt.Println(res)\n}\n```\n\n#### Output\n\n```\n298\n```\n\n\n\n\u003ca name=\"Int16Slice\"\u003e\u003c/a\u003e\n## func [Int16Slice](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L133\u003e)\n\n```go\nfunc Int16Slice(min, max, count int16) []int16\n```\n\nInt16Slice returns a slice of random int16s between min and max, inclusive. If min \\\u003e max, Int16Slice will panic. If count is less or euqal to 0, Int16SliceUnique will return an empty slice.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\ts := random.Int16Slice(1, 100, 10)\n\n\tfmt.Println(s)\n}\n```\n\n#### Output\n\n```\n[39 79 100 52 17 49 95 22 84 50]\n```\n\n\n\n\u003ca name=\"Int16SliceUnique\"\u003e\u003c/a\u003e\n## func [Int16SliceUnique](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L150\u003e)\n\n```go\nfunc Int16SliceUnique(min, max int16, count int) []int16\n```\n\nInt16SliceUnique returns a slice of unique random int16s between min and max, inclusive. If min \\\u003e max, Int16SliceUnique will panic. If count is equal or less than 0, Int16SliceUnique will return an empty slice. If count is greater than the number of int16s between min and max, Int16SliceUnique will panic.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\ts := random.Int16SliceUnique(1, 100, 10)\n\n\tfmt.Println(s)\n}\n```\n\n#### Output\n\n```\n[39 79 100 52 17 49 95 22 84 50]\n```\n\n\n\n\u003ca name=\"Int32\"\u003e\u003c/a\u003e\n## func [Int32](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L176\u003e)\n\n```go\nfunc Int32(min, max int32) int32\n```\n\nInt32 returns a random int32 between min and max, inclusive. If min \\\u003e max, Int32 panics.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\tvar min, max int32 = 0, math.MaxInt32\n\tres := random.Int32(min, max)\n\n\tfmt.Println(res)\n}\n```\n\n#### Output\n\n```\n1350205738\n```\n\n\n\n\u003ca name=\"Int32Slice\"\u003e\u003c/a\u003e\n## func [Int32Slice](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L192\u003e)\n\n```go\nfunc Int32Slice(min, max, count int32) []int32\n```\n\nInt32Slice returns a slice of random int32s between min and max, inclusive. If min \\\u003e max, Int32Slice will panic. If count is less or euqal to 0, Int32SliceUnique will return an empty slice.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\ts := random.Int32Slice(1, 100, 10)\n\n\tfmt.Println(s)\n}\n```\n\n#### Output\n\n```\n[39 79 100 52 17 49 95 22 84 50]\n```\n\n\n\n\u003ca name=\"Int32SliceUnique\"\u003e\u003c/a\u003e\n## func [Int32SliceUnique](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L209\u003e)\n\n```go\nfunc Int32SliceUnique(min, max int32, count int) []int32\n```\n\nInt32SliceUnique returns a slice of unique random int32s between min and max, inclusive. If min \\\u003e max, Int32SliceUnique will panic. If count is equal or less than 0, Int32SliceUnique will return an empty slice. If count is greater than the number of int32s between min and max, Int32SliceUnique will panic.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\ts := random.Int32SliceUnique(1, 100, 10)\n\n\tfmt.Println(s)\n}\n```\n\n#### Output\n\n```\n[39 79 100 52 17 49 95 22 84 50]\n```\n\n\n\n\u003ca name=\"Int64\"\u003e\u003c/a\u003e\n## func [Int64](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L235\u003e)\n\n```go\nfunc Int64(min, max int64) int64\n```\n\nInt64 returns a random int64 between min and max, inclusive. If min \\\u003e max, Int64 panics.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\tvar min, max int64 = 0, math.MaxInt64\n\tres := random.Int64(min, max)\n\n\tfmt.Println(res)\n}\n```\n\n#### Output\n\n```\n5799089487994996006\n```\n\n\n\n\u003ca name=\"Int64Slice\"\u003e\u003c/a\u003e\n## func [Int64Slice](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L251\u003e)\n\n```go\nfunc Int64Slice(min, max, count int64) []int64\n```\n\nInt64Slice returns a slice of random int64s between min and max, inclusive. If min \\\u003e max, Int64Slice will panic. If count is less or euqal to 0, Int64SliceUnique will return an empty slice.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\ts := random.Int64Slice(1, 100, 10)\n\n\tfmt.Println(s)\n}\n```\n\n#### Output\n\n```\n[7 7 53 64 9 58 71 56 45 34]\n```\n\n\n\n\u003ca name=\"Int64SliceUnique\"\u003e\u003c/a\u003e\n## func [Int64SliceUnique](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L268\u003e)\n\n```go\nfunc Int64SliceUnique(min, max int64, count int) []int64\n```\n\nInt64SliceUnique returns a slice of unique random int64s between min and max, inclusive. If min \\\u003e max, Int64SliceUnique will panic. If count is equal or less than 0, Int64SliceUnique will return an empty slice. If count is greater than the number of int64s between min and max, Int64SliceUnique will panic.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\ts := random.Int64SliceUnique(1, 100, 10)\n\n\tfmt.Println(s)\n}\n```\n\n#### Output\n\n```\n[7 53 64 9 58 71 56 45 34 57]\n```\n\n\n\n\u003ca name=\"Int8\"\u003e\u003c/a\u003e\n## func [Int8](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L67\u003e)\n\n```go\nfunc Int8(min, max int8) int8\n```\n\nInt8 returns a random int8 between min and max, inclusive. If min \\\u003e max, Int8 panics.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\tvar min, max int8 = 0, math.MaxInt8\n\tres := random.Int8(min, max)\n\n\tfmt.Println(res)\n}\n```\n\n#### Output\n\n```\n42\n```\n\n\n\n\u003ca name=\"Int8Slice\"\u003e\u003c/a\u003e\n## func [Int8Slice](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L78\u003e)\n\n```go\nfunc Int8Slice(min, max, count int8) []int8\n```\n\nInt8Slice returns a slice of random int8s between min and max, inclusive. If min \\\u003e max, Int8Slice will panic. If count is less or euqal to 0, Int8SliceUnique will return an empty slice.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\ts := random.Int8Slice(1, 100, 10)\n\n\tfmt.Println(s)\n}\n```\n\n#### Output\n\n```\n[39 79 100 52 17 49 95 22 84 50]\n```\n\n\n\n\u003ca name=\"Int8SliceUnique\"\u003e\u003c/a\u003e\n## func [Int8SliceUnique](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L95\u003e)\n\n```go\nfunc Int8SliceUnique(min, max int8, count int) []int8\n```\n\nInt8SliceUnique returns a slice of unique random int8s between min and max, inclusive. If min \\\u003e max, Int8SliceUnique will panic. If count is equal or less than 0, Int8SliceUnique will return an empty slice. If count is greater than the number of int8s between min and max, Int8SliceUnique will panic.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\ts := random.Int8SliceUnique(1, 100, 10)\n\n\tfmt.Println(s)\n}\n```\n\n#### Output\n\n```\n[39 79 100 52 17 49 95 22 84 50]\n```\n\n\n\n\u003ca name=\"IntSlice\"\u003e\u003c/a\u003e\n## func [IntSlice](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L23\u003e)\n\n```go\nfunc IntSlice(min, max, count int) []int\n```\n\nIntSlice returns a slice of random integers between min and max, inclusive. If min \\\u003e max, IntSlice will panic. If count is less or euqal to 0, IntSliceUnique will return an empty slice.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\ts := random.IntSlice(1, 100, 10)\n\n\tfmt.Println(s)\n}\n```\n\n#### Output\n\n```\n[39 79 100 52 17 49 95 22 84 50]\n```\n\n\n\n\u003ca name=\"IntSliceUnique\"\u003e\u003c/a\u003e\n## func [IntSliceUnique](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L40\u003e)\n\n```go\nfunc IntSliceUnique(min, max, count int) []int\n```\n\nIntSliceUnique returns a slice of unique random integers between min and max, inclusive. If min \\\u003e max, IntSliceUnique will panic. If count is equal or less than 0, IntSliceUnique will return an empty slice. If count is greater than the number of integers between min and max, IntSliceUnique will panic.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\ts := random.IntSliceUnique(1, 100, 10)\n\n\tfmt.Println(s)\n}\n```\n\n#### Output\n\n```\n[39 79 100 52 17 49 95 22 84 50]\n```\n\n\n\n\u003ca name=\"Probability\"\u003e\u003c/a\u003e\n## func [Probability](\u003chttps://github.com/atomicgo/random/blob/main/probability.go#L6\u003e)\n\n```go\nfunc Probability(p float64) bool\n```\n\nProbability returns true with a probability of p. 1 = 100%; 0.5 = 50%; 0 = 0% If p is less than 0 or greater than 1, Probability panics.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\t// We are using a pronged coin with a 80% chance of landing on Heads.\n\tif random.Probability(0.8) {\n\t\tfmt.Println(\"Heads\")\n\t} else {\n\t\tfmt.Println(\"Tails\")\n\t}\n\n}\n```\n\n#### Output\n\n```\nHeads\n```\n\n\n\n\u003ca name=\"Seed\"\u003e\u003c/a\u003e\n## func [Seed](\u003chttps://github.com/atomicgo/random/blob/main/random.go#L16\u003e)\n\n```go\nfunc Seed(seed int64)\n```\n\nSeed sets the seed of the random generator. By default, the seed is already randomized on package initialization. You only need to call this function if you need a specific seed.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337)\n}\n```\n\n\n\n\u003ca name=\"Shuffle\"\u003e\u003c/a\u003e\n## func [Shuffle](\u003chttps://github.com/atomicgo/random/blob/main/slice.go#L46\u003e)\n\n```go\nfunc Shuffle[T any](s []T) []T\n```\n\nShuffle returns a shuffled copy of a slice.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\ts := []int{1, 2, 3, 4, 5}\n\tfmt.Print(random.Shuffle(s))\n\n}\n```\n\n#### Output\n\n```\n[1 3 5 2 4]\n```\n\n\n\n\u003ca name=\"String\"\u003e\u003c/a\u003e\n## func [String](\u003chttps://github.com/atomicgo/random/blob/main/string.go#L15\u003e)\n\n```go\nfunc String(l int, set string) string\n```\n\nString returns a random string of length l, using the characters in the set. If l is less than 0, String panics. If the set is empty, or l is 0, String returns an empty string.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\tfmt.Print(random.String(5, random.StringSetLowercase+random.StringSetUppercase))\n\n}\n```\n\n#### Output\n\n```\nYsFVm\n```\n\n\n\n\u003ca name=\"StringSlice\"\u003e\u003c/a\u003e\n## func [StringSlice](\u003chttps://github.com/atomicgo/random/blob/main/string.go#L36\u003e)\n\n```go\nfunc StringSlice(l int, set string, count int) []string\n```\n\nStringSlice returns a slice of random strings of length l, using the characters in the set. If l is less than 0, StringSlice panics. If the set is empty, or l is 0, StringSlice returns an empty slice. If count is less than 0, StringSlice will panic.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\ts := random.StringSlice(5, random.StringSetLowercase+random.StringSetUppercase, 5)\n\tfmt.Println(s)\n\n}\n```\n\n#### Output\n\n```\n[YsFVm KAfdn AIdJS kxApO apmsT]\n```\n\n\n\n\u003ca name=\"Uint\"\u003e\u003c/a\u003e\n## func [Uint](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L294\u003e)\n\n```go\nfunc Uint(min, max uint) uint\n```\n\nUint returns a random uint between min and max, inclusive. If min \\\u003e max, Uint will panic.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\tvar min, max uint = 0, math.MaxUint\n\tres := random.Uint(min, max)\n\n\tfmt.Println(res)\n}\n```\n\n#### Output\n\n```\n15022461524849771814\n```\n\n\n\n\u003ca name=\"Uint16\"\u003e\u003c/a\u003e\n## func [Uint16](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L402\u003e)\n\n```go\nfunc Uint16(min, max uint16) uint16\n```\n\nUint16 returns a random uint16 between min and max, inclusive. If min \\\u003e max, Uint16 panics.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\tvar min, max uint16 = 0, math.MaxUint16\n\tres := random.Uint16(min, max)\n\n\tfmt.Println(res)\n}\n```\n\n#### Output\n\n```\n596\n```\n\n\n\n\u003ca name=\"Uint16Slice\"\u003e\u003c/a\u003e\n## func [Uint16Slice](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L413\u003e)\n\n```go\nfunc Uint16Slice(min, max, count uint16) []uint16\n```\n\nUint16Slice returns a slice of random uint16s between min and max, inclusive. If min \\\u003e max, Uint16Slice will panic. If count is less or euqal to 0, Uint16SliceUnique will return an empty slice.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\ts := random.Uint16Slice(1, 100, 10)\n\n\tfmt.Println(s)\n}\n```\n\n#### Output\n\n```\n[77 58 99 3 33 97 89 43 68 100]\n```\n\n\n\n\u003ca name=\"Uint16SliceUnique\"\u003e\u003c/a\u003e\n## func [Uint16SliceUnique](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L430\u003e)\n\n```go\nfunc Uint16SliceUnique(min, max uint16, count int) []uint16\n```\n\nUint16SliceUnique returns a slice of unique random uint16s between min and max, inclusive. If min \\\u003e max, Uint16SliceUnique will panic. If count is equal or less than 0, Uint16SliceUnique will return an empty slice. If count is greater than the number of uint16s between min and max, Uint16SliceUnique will panic.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\ts := random.Uint16SliceUnique(1, 100, 10)\n\n\tfmt.Println(s)\n}\n```\n\n#### Output\n\n```\n[77 58 99 3 33 97 89 43 68 100]\n```\n\n\n\n\u003ca name=\"Uint32\"\u003e\u003c/a\u003e\n## func [Uint32](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L456\u003e)\n\n```go\nfunc Uint32(min, max uint32) uint32\n```\n\nUint32 returns a random uint32 between min and max, inclusive. If min \\\u003e max, Uint32 panics.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\tvar min, max uint32 = 0, math.MaxUint32\n\tres := random.Uint32(min, max)\n\n\tfmt.Println(res)\n}\n```\n\n#### Output\n\n```\n2700411476\n```\n\n\n\n\u003ca name=\"Uint32Slice\"\u003e\u003c/a\u003e\n## func [Uint32Slice](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L472\u003e)\n\n```go\nfunc Uint32Slice(min, max, count uint32) []uint32\n```\n\nUint32Slice returns a slice of random uint32s between min and max, inclusive. If min \\\u003e max, Uint32Slice will panic. If count is less or euqal to 0, Uint32SliceUnique will return an empty slice.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\ts := random.Uint32Slice(1, 100, 10)\n\n\tfmt.Println(s)\n}\n```\n\n#### Output\n\n```\n[77 58 99 3 33 97 89 43 68 100]\n```\n\n\n\n\u003ca name=\"Uint32SliceUnique\"\u003e\u003c/a\u003e\n## func [Uint32SliceUnique](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L489\u003e)\n\n```go\nfunc Uint32SliceUnique(min, max uint32, count int) []uint32\n```\n\nUint32SliceUnique returns a slice of unique random uint32s between min and max, inclusive. If min \\\u003e max, Uint32SliceUnique will panic. If count is equal or less than 0, Uint32SliceUnique will return an empty slice. If count is greater than the number of uint32s between min and max, Uint32SliceUnique will panic.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\ts := random.Uint32SliceUnique(1, 100, 10)\n\n\tfmt.Println(s)\n}\n```\n\n#### Output\n\n```\n[77 58 99 3 33 97 89 43 68 100]\n```\n\n\n\n\u003ca name=\"Uint64\"\u003e\u003c/a\u003e\n## func [Uint64](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L515\u003e)\n\n```go\nfunc Uint64(min, max uint64) uint64\n```\n\nUint64 returns a random uint64 between min and max, inclusive. If min \\\u003e max, Uint64 panics.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\tvar min, max uint64 = 0, math.MaxUint64\n\tres := random.Uint64(min, max)\n\n\tfmt.Println(res)\n}\n```\n\n#### Output\n\n```\n15022461524849771814\n```\n\n\n\n\u003ca name=\"Uint64Slice\"\u003e\u003c/a\u003e\n## func [Uint64Slice](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L531\u003e)\n\n```go\nfunc Uint64Slice(min, max, count uint64) []uint64\n```\n\nUint64Slice returns a slice of random uint64s between min and max, inclusive. If min \\\u003e max, Uint64Slice will panic. If count is less or euqal to 0, Uint64SliceUnique will return an empty slice.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\ts := random.Uint64Slice(1, 100, 10)\n\n\tfmt.Println(s)\n}\n```\n\n#### Output\n\n```\n[15 15 53 72 9 66 79 64 53 34]\n```\n\n\n\n\u003ca name=\"Uint64SliceUnique\"\u003e\u003c/a\u003e\n## func [Uint64SliceUnique](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L548\u003e)\n\n```go\nfunc Uint64SliceUnique(min, max uint64, count int) []uint64\n```\n\nUint64SliceUnique returns a slice of unique random uint64s between min and max, inclusive. If min \\\u003e max, Uint64SliceUnique will panic. If count is equal or less than 0, Uint64SliceUnique will return an empty slice. If count is greater than the number of uint64s between min and max, Uint64SliceUnique will panic.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\ts := random.Uint64SliceUnique(1, 100, 10)\n\n\tfmt.Println(s)\n}\n```\n\n#### Output\n\n```\n[15 53 72 9 66 79 64 34 57 17]\n```\n\n\n\n\u003ca name=\"Uint8\"\u003e\u003c/a\u003e\n## func [Uint8](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L348\u003e)\n\n```go\nfunc Uint8(min, max uint8) uint8\n```\n\nUint8 returns a random uint8 between min and max, inclusive. If min \\\u003e max, Uint8 panics.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\tvar min, max uint8 = 0, math.MaxUint8\n\tres := random.Uint8(min, max)\n\n\tfmt.Println(res)\n}\n```\n\n#### Output\n\n```\n84\n```\n\n\n\n\u003ca name=\"Uint8Slice\"\u003e\u003c/a\u003e\n## func [Uint8Slice](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L359\u003e)\n\n```go\nfunc Uint8Slice(min, max, count uint8) []uint8\n```\n\nUint8Slice returns a slice of random uint8s between min and max, inclusive. If min \\\u003e max, Uint8Slice will panic. If count is less or euqal to 0, Uint8SliceUnique will return an empty slice.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\ts := random.Uint8Slice(1, 100, 10)\n\n\tfmt.Println(s)\n}\n```\n\n#### Output\n\n```\n[77 58 99 3 33 97 89 43 68 100]\n```\n\n\n\n\u003ca name=\"Uint8SliceUnique\"\u003e\u003c/a\u003e\n## func [Uint8SliceUnique](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L376\u003e)\n\n```go\nfunc Uint8SliceUnique(min, max uint8, count int) []uint8\n```\n\nUint8SliceUnique returns a slice of unique random uint8s between min and max, inclusive. If min \\\u003e max, Uint8SliceUnique will panic. If count is equal or less than 0, Uint8SliceUnique will return an empty slice. If count is greater than the number of uint8s between min and max, Uint8SliceUnique will panic.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\ts := random.Uint8SliceUnique(1, 100, 10)\n\n\tfmt.Println(s)\n}\n```\n\n#### Output\n\n```\n[77 58 99 3 33 97 89 43 68 100]\n```\n\n\n\n\u003ca name=\"UintSlice\"\u003e\u003c/a\u003e\n## func [UintSlice](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L305\u003e)\n\n```go\nfunc UintSlice(min, max, count uint) []uint\n```\n\nUintSlice returns a slice of random uints between min and max, inclusive. If min \\\u003e max, UintSlice will panic. If count is less or euqal to 0, UintSliceUnique will return an empty slice.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\ts := random.UintSlice(1, 100, 10)\n\n\tfmt.Println(s)\n}\n```\n\n#### Output\n\n```\n[15 15 53 72 9 66 79 64 53 34]\n```\n\n\n\n\u003ca name=\"UintSliceUnique\"\u003e\u003c/a\u003e\n## func [UintSliceUnique](\u003chttps://github.com/atomicgo/random/blob/main/number.go#L322\u003e)\n\n```go\nfunc UintSliceUnique(min, max uint, count int) []uint\n```\n\nUintSliceUnique returns a slice of unique random uints between min and max, inclusive. If min \\\u003e max, UintSliceUnique will panic. If count is equal or less than 0, UintSliceUnique will return an empty slice. If count is greater than the number of uints between min and max, UintSliceUnique will panic.\n\n\n\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"atomicgo.dev/random\"\n)\n\nfunc main() {\n\trandom.Seed(1337) // Set seed for deterministic output, not required\n\n\ts := random.UintSliceUnique(1, 100, 10)\n\n\tfmt.Println(s)\n}\n```\n\n#### Output\n\n```\n[15 53 72 9 66 79 64 34 57 17]\n```\n\n\n\nGenerated by [gomarkdoc](\u003chttps://github.com/princjef/gomarkdoc\u003e)\n\n\n\u003c!-- gomarkdoc:embed:end --\u003e\n\n---\n\n\u003e [AtomicGo.dev](https://atomicgo.dev) \u0026nbsp;\u0026middot;\u0026nbsp;\n\u003e with ❤️ by [@MarvinJWendt](https://github.com/MarvinJWendt) |\n\u003e [MarvinJWendt.com](https://marvinjwendt.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomicgo%2Frandom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatomicgo%2Frandom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomicgo%2Frandom/lists"}