dwyl / cid

❄️cid ("content id") is a human-friendly (readable/typeable) unique ID function built for distributed/decentralised systems.
GNU General Public License v2.0
34 stars 3 forks source link

Make a CID from an Ecto Changeset #7

Open nelsonic opened 5 years ago

nelsonic commented 5 years ago
RobStallion commented 5 years ago

https://github.com/dwyl/cid/pull/21 will work with an Ecto.changeset. Ecto changesets are structs themselves, which means that we can call Map.from_struct/1 on a changeset and get a map.

That map can then be turned into a JSON string, hashed and turned into a CID.