Error when i create jsSHA object
See original GitHub issueI have react application. I have implemented jsSHA library installed using npm. When I initiate the object getting Uncaught TypeError: jsSHA is not a constructor. Below my code
const hash_obj_mobile_number = new jsSHA("SHA-256", "TEXT", { encoding: "UTF8" }), hash_obj_consent_pin = new jsSHA("SHA-256", "TEXT", { encoding: "UTF8" }); hash_obj_mobile_number.update(mobile_number); hash_obj_consent_pin.update(login_pin); const hash_mobile_number = hash_obj_mobile_number.getHash("HEX"); const hash_consent_pin = hash_obj_consent_pin.getHash("HEX");
Issue Analytics
- State:
- Created 3 years ago
- Comments:24 (13 by maintainers)
Top Results From Across the Web
jssha - npm
Instantiate a new jsSHA object with the desired hash variant, input format, and options as parameters. The hash variant can be one of...
Read more >Microsoft JScript runtime error Object doesn't support this ...
It is occuring when trying to call hmacObj.getHMAC. This is from the jsSHA website: http://jssha.sourceforge.net/ to use the hmac-sha1 algorithm ...
Read more >jsSHA - SHA Hashes and HMAC in JavaScript
Javascript Course · 1. Instantiate a new jsSHA object (here sha_ob), using new jsSHA() with the desired hash type ('SHA-Type'), and input type...
Read more >JavaScript Error Objects - Flavio Copes
A SyntaxError is raised when a syntax error is found in a program. Here are some examples of code that generate a syntax...
Read more >Caligatio/jsSHA | Build 87 | src/common.ts | Coveralls - Test ...
throw new Error("Invalid outputUpper formatting option"); ... Parses an external constructor object and returns a packed number, if possible.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@joadr: Try adding
"esModuleInterop": true
into yourtsconfig.json
if it’s not already in there (see my tsconfig.json for an example). I remember some funniness with TypeScript and default imports which I believe was fixed with that config.This worked for me.