Giter VIP home page Giter VIP logo

Comments (4)

emptycrown avatar emptycrown commented on August 11, 2024 4

Thanks. For reference, I figured out that the following yields the same results as the current circom version (no need to downgrade circomlibjs).

let hashBytes = poseidon([4, 9]);
let hash = poseidon.F.toString(hashBytes);

from circomlibjs.

nanaknihal avatar nanaknihal commented on August 11, 2024

It seems the newer versions of circomlibjs have a different implementation of the Poseidon hash. This error was fixed when I downgraded to [email protected] (perhaps some versions in between will work too; I haven't tried).

from circomlibjs.

Sean4572435243 avatar Sean4572435243 commented on August 11, 2024

Suggestion: If there was a github repository test that forced an equality comparison between the poseidon_wasm.js code and a poseidon circuit, it would be really helpful. Took me weeks to pull this all together myself.

from circomlibjs.

samlaf avatar samlaf commented on August 11, 2024

Thanks. For reference, I figured out that the following yields the same results as the current circom version (no need to downgrade circomlibjs).

let hashBytes = poseidon([4, 9]);
let hash = poseidon.F.toString(hashBytes);

Thank you so much for this!! I was using ffjavascript's utils.stringifyBigInts instead of F.toString(). Not sure what that method is doing, but it was returning other numbers.

js is such a pain to code with.. because we don't get suggestions. Really wishing this had been coded in ts, since vscode would have suggested poseidon.F.toString most likely.

from circomlibjs.

Related Issues (16)

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.