[solved] Cannot reproduce unique identifier with md5sum


Seeing here that there are unique IDs for each content, I would like to reproduce it in the console.

Seeing in the code that the unique ID is the md5sum of the file logical name, I would like to reproduce it.

The doc says that uniqueID of a file named blog/post.md is 81df004c333b392d34a49fd3a91ba720.

So I try it:

$ echo "blog/post.md" | md5sum
cc1cb53e5916fbff7926996c1a891f62  -
$ echo "content/blog/post.md" | md5sum
c6064f42226ff6feb95493426e6a5ace  -
$ echo "./content/blog/post.md" | md5sum
1bc227b0082650ef54498f42d09b3da3  -
$ echo "/content/blog/post.md" | md5sum
9461664fe7829efbbd5fadd193db7ca3  -
$ echo "post.md" | md5sum
b1b98156a5d0a4d617e1ac00be10fb8d  -
$ echo "blog/post.html" | md5sum
a297e5264c52e1c57484e47e8630850d  -
$ echo "content/blog/post.html" | md5sum
daceba8511c55690585a050a1cd91d9c  -
$ echo "./content/blog/post.html" | md5sum
fcb1ac0008e6f853a03e922f6fe33d68  -

How to actually get 81df004c333b392d34a49fd3a91ba720?

Echo adds a newline – try your first one with echo -n.

1 Like

Well seen. Thanks!