Comments (6)
I can do a PR but I admittedly I'm not DefinitelyTyped expert. Should it be:
getHMAC(key:string, inputFormat:string, variant:string, outputFormat:string, outputFormatOpts?:OutputFormatOptions):string;
If so, I'll submit things
from jssha.
Check these 2 files:
\node_modules\@types\jssha\index.d.ts
\node_modules\@types\jssha\jssha-1.6.0.d.ts
I copied content of jssha-1.6.0.d.ts
and inserted to index.d.ts
These helped me. I know that I shouldn't touch files in node_modules
folder but I don't know how to do this in other way.
It seems that definition is wrong of function getHMAC
in index.d.ts
but it is correct in second file.
Maybe someone find more beautiful solution but this works for me.
from jssha.
Is that signature error some sort of Typescript error? I've never seen JavaScript emit something like that. My guess is that Typescript doesn't like optional parameters so try passing in an empty map, {}
, as an extra last parameter.
from jssha.
Is this something I can actually fix or is there something wrong with whatever helper libraries you are using?
from jssha.
This is an issue with the community contributed type definitions for typescript, and something that should be fixed in the "definitelyTyped" repository.
Specifically, this file:
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/jssha/index.d.ts
or this file:
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/jssha/jssha-1.6.0.d.ts
from jssha.
I think I understand what's going on. Whatever tutorial you're using is using an old version of jsSHA (the v1 branch) which is deprecated and only receiving bug fixes. The DefinitelyTyped library moved on to the v2 API, thus the mismatch between the index.d.ts and jssha-1.6.0.d.ts. It also appears that someone deleted the jssha-1.6.0.d.ts file from DefinitelyTyped so I don't know if they're no longer supporting the concept of "old" library versions.
I'm closing this because it essentially has nothing to do with jsSHA and everything to do with DefinitelyTyped.
from jssha.
Related Issues (20)
- Method chaining when using `update` HOT 7
- Typescript build error HOT 2
- Types are packaged/exposed incorrectly HOT 2
- Feature request: HKDF would be nice HOT 1
- Feature Request: KangarooTwelve and MarsupilamiFourteen HOT 6
- ESM package for jssha HOT 1
- How to generate the SHA3-256 hash? HOT 1
- Encrypt sha256 in c# and make it the same key HOT 4
- 43106983S HOT 1
- setHMACKey with B64 HOT 4
- Error when i create jsSHA object HOT 24
- Performance HOT 12
- Package exports do not define a valid '.' target HOT 6
- Recreate internal state HOT 6
- SCRIPT:1002 Syntax Error HOT 3
- Question : How to reset / clear for another hash? HOT 2
- Installing this package via a <script> tag HOT 2
- Deno support documentation
- Reading custom amount of bytes with SHAKE HOT 2
- Incorrect project website in README.md HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jssha.