https://github.com/heppu/seed-finder
Go tool that finds seed numbers for words
https://github.com/heppu/seed-finder
go random
Last synced: about 2 months ago
JSON representation
Go tool that finds seed numbers for words
- Host: GitHub
- URL: https://github.com/heppu/seed-finder
- Owner: heppu
- License: mit
- Created: 2016-07-12T23:51:36.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-07-13T00:06:21.000Z (about 10 years ago)
- Last Synced: 2025-01-04T22:44:59.679Z (over 1 year ago)
- Topics: go, random
- Language: Go
- Size: 741 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Seed finder
Go tool that finds math/rand seed number for given word. Right now it's limited to [a-z] but can be easily modified for wider ascii range.
## Usage
```sh
go get github.com/heppu/seed-finder
go install seed-finder
seed-finder -w hello
```
## Example
```go
package main
import (
"fmt"
"math/rand"
)
func main() {
fmt.Println(getRandStr(-4611686018426513711, 5))
fmt.Println(getRandStr(13143826, 5))
}
func getRandStr(seed int64, len int) (s string) {
rand.Seed(seed)
for i := 0; i < len; i++ {
s += string(rand.Intn(26) + 97)
}
return
}
```