public inbox for nncp-devel@lists.cypherpunks.ru
Atom feed
* Case-sensitivity of Node IDs
@ 2021-10-24 23:21 Koushik Roy
  2021-10-27  7:52 ` Sergey Matveev
  0 siblings, 1 reply; 2+ messages in thread
From: Koushik Roy @ 2021-10-24 23:21 UTC (permalink / raw)
  To: nncp-devel

Hey,

I was wondering if it's expected behavior for node IDs to _have_ to be
upper-case. If this is intended behavior, would it be possible to note
this either in the docs or to have a better error message when rejecting
node IDs from the CLI tools?

I was trying to use `nncp-exec` to call a few handles but was passing in
the node ID lowercase which is where I ran into the issue.

Thanks,
Koushik

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Case-sensitivity of Node IDs
  2021-10-24 23:21 Case-sensitivity of Node IDs Koushik Roy
@ 2021-10-27  7:52 ` Sergey Matveev
  0 siblings, 0 replies; 2+ messages in thread
From: Sergey Matveev @ 2021-10-27  7:52 UTC (permalink / raw)
  To: nncp-devel

[-- Attachment #1: Type: text/plain, Size: 1288 bytes --]

Greetings!

*** Koushik Roy [2021-10-24 16:21]:
>I was wondering if it's expected behavior for node IDs to _have_ to be upper-case.

You can specify node ID either by its Base32-encoded representation, or
by its alias human-readable name, as it appears in configuration file
(like "self" for example, existing out of box). Human-readable ids have
to be passed as-is as they are written in configuration -- they are case
sensitive. Non-human-readable ids have to be passed as-is too. Base32
encoding uses uppercase alphabet characters.

So, ids just have to be passed as-is. Base32 is upper-case. I wonder who
and how mangle those ids? One just should not alter ids anyhow. Because
raw Base32 encoded ids are not indented for humans, they should be
copy-pasted/used as-is, not mangled by scripts. I think it would be
excess note that "node ids have to be passed as-is", because in my
opinion it should be assumed by default.

If I passed invalid case in Base32 encoded id, then utility will give:
    main.go:119: Invalid NODE specified: Can not parse node: 2W...Bq: illegal base32 data at input byte 51
that explicitly tells about wrong encoding format.

-- 
Sergey Matveev (http://www.stargrave.org/)
OpenPGP: CF60 E89A 5923 1E76 E263  6422 AE1A 8109 E498 57EF

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-27  7:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-24 23:21 Case-sensitivity of Node IDs Koushik Roy
2021-10-27  7:52 ` Sergey Matveev