Skip to content

result is NaN #1

@MarshallAsch

Description

@MarshallAsch

I found that there is a timing issue where if the generator is called before the http request to get the random numbers completes then NaN is returned. This is causing issues for me when running automated tests because there does not seem to be the extra delay that is needed for actual numbers to be returned.

Below is my sample code that produces the result.

const { rand: Random } = require('true-random/es6');
const generator = new Random();
generator.integers(1, 16, 24).map((r) => Math.trunc(r).toString(16).toUpperCase()).join('')

(I am using true-random/es6 because without the /es6 part it has issues running the tests for some reason)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions