søren peter mørch

Conversation

Recent posts in reply to #zd4utgq

sorenpeter (darch.dk)

@prologic 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

In reply to: #zd4utgq 2 years ago
david (collantes.us)

@sorenpeter a TAB is simply \t. Just add it to that echo line, and that's it.

In reply to: #zd4utgq 2 years ago
sorenpeter (darch.dk)

Thanks @david, good to know, but we need to agree on what character we use, otherwise the hashes will not be the same:)

In reply to: #zd4utgq 2 years ago
david (collantes.us)

@sorenpeter 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.

In reply to: #zd4utgq 2 years ago
david (collantes.us)

PHP uses \t as well for TABs.

In reply to: #zd4utgq 2 years ago
falsifian (www.falsifian.org)

@prologic 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

In reply to: #zd4utgq 2 years ago
Reply via email