Standarized seed generation and validation for Datamosh
npm install @datamosh-js/seederStandarized seed generation and validation for Datamosh.
Seeder is not idempotent; it uses the current timestamp when creating the seed.
js
const { seeder } = require('@datamosh-js/seeder')
seeder('really', () => 'interesting', { arguments: ':)' })
// '21620145'
`Needing something a bit longer...
`js
const { seeder512 } = require('@datamosh-js/seeder')
seeder512('really', ['really'], { cool: 'args' })
// '33a6b55f2df7d44c24544193f302e76e31a44c1e2ce1c2621d3077a8c6b7d177b1c0bd08bd2319bb16aa2556197ffcd5f521d228865599eecc6645d53f44fd12'
`Usage
$3
Makes a 4 byte hexadecimal hash
* arguments : String coercible metadata used when generating the seed
* Returns: seed : 4 byte hexadecimal hash$3
Makes a SHA512 hexadecimal hash
* arguments : String coercible metadata used when generating the seed
* Returns: seed : SHA512 hexadecimal hash$3
Validate seed from seeder
* arguments : Seed to validate
* nibbles : Expected hex nibble count
* Returns: result