crypto-async | reliable cipher , hash and hmac methods | Hashing library
kandi X-RAY | crypto-async Summary
kandi X-RAY | crypto-async Summary
Fast, reliable cipher, hash and hmac methods executed in Node's threadpool for multi-core throughput.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of crypto-async
crypto-async Key Features
crypto-async Examples and Code Snippets
Community Discussions
Trending Discussions on crypto-async
QUESTION
I've built a middleware function to validate user access tokens (JWT) ... if the JWT has expired, I automatically create a new access token from the user's refresh token (if it as well is valid, of course).
I imagine that at some point, if I have enough users, authorization could be a bottleneck. I'd like to ensure these functions are running asynchronously (e.g. via the UV threadpool).
Is this possible, or do I even have to worry about this?
ADDENDUM:
This is the decryption routine I'm using in my middleware function. I'm also using jsonwebtoken.
...ANSWER
Answered 2020-Aug-10 at 00:30It's actually pretty hard to write code that blocks the main thread in Node for a significant time unless you are doing some seriously heavy lifting, such as generating very large reports or the like. Authorization via JWT tokens is totally lightweight and will not be a problem, I can virtually guarantee that. You will not need to push that type of work off onto a separate thread, if that was the plan.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install crypto-async
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page