carbon-io / carbond

MIT License
2 stars 5 forks source link

Hasher.getHasher("bcrypt") not working #170

Closed willshulman closed 7 years ago

willshulman commented 7 years ago

For some reason it does not return the right value. It returns {}. While debugging and printing out the contents of Hasher._getHashers I see this:

{ bcrypt: {},
  noop: 
   { [Function]
     __isAtomDefined__: true,
     super_: 
      { [Function]
        __isAtomDefined__: true,
        super_: [Function: Object],
        getHasher: [Function],
        getHasherNames: [Function],
        _hashers: [Circular] } },
  sha256: 
   { [Function]
     __isAtomDefined__: true,
     super_: 
      { [Function]
        __isAtomDefined__: true,
        super_: [Function: Object],
        getHasher: [Function],
        getHasherNames: [Function],
        _hashers: [Circular] } } }
willshulman commented 7 years ago

I am wondering if we should just remove the global static registry of Hashers. I have been just pointing directly to the Hasher objects and it has been much simpler and easy to manage / understand. My feeling is why create a new namespace when we have the module namespace...

Lets' discuss.

gregbanks commented 7 years ago

:selfie:

willshulman commented 7 years ago

Re-opening this. I think we might want to re-work slightly. Will elaborate soon.

willshulman commented 7 years ago

Actually taking this to another ticket: #191