Code Monkey home page Code Monkey logo

Comments (5)

brycedarling avatar brycedarling commented on August 20, 2024 1

@sveredyuk as far as I know, the hash is only useful for an exact equality lookup. a string like "this is some text" will be hashed to a value like DV5hk0ryjAsvSp3uFhhLog1tLp3/aA7/ttGFAq1yg9k= so it wouldn't be very useful to do a LIKE query on. when searching the table, the value you are looking for also gets hashed so that it can try find a row with that exact same matching hash.

from cloak_ecto.

sveredyuk avatar sveredyuk commented on August 20, 2024 1

Definitely. Using LIKE for hashed values will give you nothing. Or exact match or just use another soution

from cloak_ecto.

brycedarling avatar brycedarling commented on August 20, 2024

Nevermind, found it in the docs after thinking to search for "hash" ;)

https://hexdocs.pm/cloak_ecto/Cloak.Ecto.PBKDF2.html#module-usage

Thank you!

from cloak_ecto.

sveredyuk avatar sveredyuk commented on August 20, 2024

Hi, I have maybe a stupid question but is it possible to search with like or like by hashed fields?

from cloak_ecto.

acrolink avatar acrolink commented on August 20, 2024

@sveredyuk as far as I know, the hash is only useful for an exact equality lookup. a string like "this is some text" will be hashed to a value like DV5hk0ryjAsvSp3uFhhLog1tLp3/aA7/ttGFAq1yg9k= so it wouldn't be very useful to do a LIKE query on. when searching the table, the value you are looking for also gets hashed so that it can try find a row with that exact same matching hash.

I have the same suspicion. Correct, true ? only exact full string match would work?

from cloak_ecto.

Related Issues (17)

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.