Toy implementation of the PedersenHash function used to illustrate several of its vulnerabilities when the requirements on the encoding function are not followed properly.
It accompanies the blog post entitled "Breaking Pedersen Hashes in Practice" hosted on NCC Group's Research Platform at https://research.nccgroup.com/2023/03/22/breaking-pedersen-hashes-in-practice/
The code can be run with SageMath, as follows.
> sage pedersen.sage