@prologic@twtxt.net Regarding the new way of generating twt-hashes, to me it makes more sense to use tabs as separator instead of spaces, since the you can just copy/past a line directly from a twtxt-file that already go a tab between timestamp and message. But tabs might be hard to “type” when you are in a terminal, since it will activate autocomplete…🤔
Another thing, it seems that you sugget we only use the domain in the hash-creation and not the full path to the twtxt.txt
$ echo -e "https://example.com 2024-09-29T13:30:00Z Hello World!" | sha256sum - | awk '{ print $1 }' | base64 | head -c 12
@sorenpeter@darch.dk a TAB is simply \t
. Just add it to that echo
line, and that’s it.
Thanks @david@collantes.us, good to know, but we need to agree on what character we use, otherwise the hashes will not be the same:)
@sorenpeter@darch.dk oh, I thought we were settled on TABs for a while now, weren’t we? 🤔 The new website mentions TABs too. The command echo -e
(on any shell?) will use \t
for them.
PHP uses \t
as well for TABs.
@prologic@twtxt.net I think printf is a more portable option than echo -e for interpreting \t as tab. E.g. printf ‘%s\t%s\t%s’ “$url” “$time” “$text”. In general I always prefer printf over echo for anything non-trivial in unix shell scripts. See last paragraph of https://en.wikipedia.org/wiki/Echo_(command)#History
@sorenpeter@darch.dk I think this is a rype will fix!
@falsifian@www.falsifian.org Agreed
Btw anyone can put up PR(s) 🙃