slynova-org / hash Goto Github PK
View Code? Open in Web Editor NEW๐ Framework-agnostic driver based system for password hashing algorithms in Node.js
๐ Framework-agnostic driver based system for password hashing algorithms in Node.js
The hash
module is a great package when using standalone. However, I was thinking of making handful of changes to make it jell well in the AdonisJs ecosystem.
The @poppinss/manager package is something I am planning to use for every component, which uses the builder pattern
or has driver based API
.
The package assumes that you will make use of the IoC container, which makes sense for AdonisJs, but not for packages to be used standalone. To encounter that, we need to write bit of extra code and hide the IoC container layer from the end user.
Main hash class
class Hash extends Manager {
constructor (container) {
super(container)
}
}
Now when we register the Hash
class as a provider to the IoC container, we can provider the Ioc container
reference to the class constructor.
When using it standalone, we can wrap this class inside another class.
class HashStandalone extends Hash {
constructor () {
super({}) // passing empty object
}
}
The HashStandalone
is shared for standalone usage.
driver
over use
.Since, I am planning to keep the API identical everywhere, I would love to replace use
with driver
method, and driver
method already exists on the Manager
class.
The Phc string format encodes the hashing info within the hash string and it makes it possible to upgrade older hash values whenever required.
needsRehash
You shared this with me earlier and I think, it's a good idea to add support for needsRehash
and we will need PHC string format
for that.
WHAT YEAH THINK?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.