Skip to content

How to access SecureRandom in jsbn typescript? #40

@bouasavanhhop

Description

@bouasavanhhop

I used to access the SecureRandom in jsbn.js this way

var jsbn = require('jsbn');
var SecureRandom = jsbn.SecureRandom;
var secureRandom = new SecureRandom();
secureRandom.nextBytes(x);

How do I access it in jsbn.ts. As there seem to be limited functions to import

 import jsbn, {BigInteger, RandomGenerator as SecureRandom} from "jsbn";

package.json

"dependencies": {
  "jsbn": "^1.1.0"
},
"devDependencies": {
  "@types/jsbn": "^1.2.29",
}

Thank you.

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