Giter Site home page Giter Site logo

Comments (4)

tjconcept avatar tjconcept commented on June 11, 2024

Whatever is returned from hash is supposed to go unmodified into verify again.

The fact that hash returns a JSON string is an implementation detail, is not documented, and could change without triggering a new major release. That's why you should not parse it and not store it as anything else than an opaque value.

If you really want to, you should parse it on one side (after hash) and stringify it on the other (before verify).

from credential.

matt-oakes avatar matt-oakes commented on June 11, 2024

Ah OK. That makes sense. From the description of hash it says explicitly that it returns a JSON object, so I thought it would be stable. I'll change my database schema to simply accept a string.

Thanks for the quick reply!

from credential.

tjconcept avatar tjconcept commented on June 11, 2024

You're right, and I might be over-idealistic about it but unless you have some really good reason to, I'd not run the risk.

I'll close this for now, but feel free to follow up, I'll answer or reopen if necessary :)

from credential.

matt-oakes avatar matt-oakes commented on June 11, 2024

No problem at all, I can see the reasoning for it, and I'll hever used the password hash JSON directly, so it makes no difference to me.

It might be worth making this recommendation in the readme though, just in case.

from credential.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.