# Onion address encoding [closed]

Could you please explain what the pipe (|) in tor specification means -- is it a bitwise or or a concatenation of the values?

The onion address of a hidden service includes its identity public key, a version field and a basic checksum. All this information is then base32 encoded as shown below:

onion_address = base32(PUBKEY | CHECKSUM | VERSION) + ".onion"

CHECKSUM = H(".onion checksum" | PUBKEY | VERSION)[:2]

where:

• PUBKEY is the 32 bytes ed25519 master pubkey of the hidden service.
• VERSION is an one byte version field (default value '\x03')
• ".onion checksum" is a constant string
• CHECKSUM is truncated to two bytes before inserting it in onion_address

From the context, I understand it is a concatenation-- is that so?

If one has a working short Python\Node\Ruby snippet for that, it would be lovely. :)

## closed as off-topic by forest, Maeher, AleksanderRas, kelalaka, Maarten Bodewes♦Jul 11 at 9:58

• This question does not appear to be about cryptography within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

• I'm voting to close this question as off-topic because it is not related to cryptography, but to the meaning of symbols in the technical specifications for a cryptographic tool. – forest Jul 6 at 22:50
• Putting this on hold, Mr. The meaning of the symbol | depends on context, in this case Tor. Such questions are not related to cryptography but to the protocol in question. – Maarten Bodewes Jul 11 at 9:57

As you suspect, it's a concatenation symbol. Some times it's $$|$$ and others $$||$$. Or $$+$$. Python and PL/SQL examples to confirm. Or a cryptographic example: bottom of page 5 of FIPS PUB 202: SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions.
If it were bitwise OR, you'd make a real mess of the public key's use with PUBKEY | CHECKSUM | VERSION.