@dvlden/seeran
v1.0.0
Published
Simple pseudorandom number generator that takes a seed as string or number.
Downloads
1
Maintainers
Readme
Seeran
Simple pseudorandom number generator that takes a seed as string or number. Written as a generator function that can be ran once or as many times as you need.
Check test cases if you are still wondering what it does.
Installation
Use your favourite package manager... In my case that's pnpm
.
pnpm i @dvlden/seeran
Importing
ESM
import { seeran } from '@dvlden/seeran'
Node
const { seeran } = require('@dvlden/seeran')
Usage
// Basic
const { value } = seeran().next()
// With seed
const { value } = seeran('hello').next()
// Iteration
const sr = seeran('wow')
for (let i = 0; i < 10; i++) {
console.log(sr.next().value)
}