How to hash without salt?
I really need to hash without salt (https://docs.oxen.io/oxen-docs/products-built-on-oxen/session/loki-name-system-for-session) and by that I mean salt that is equal to 0 bytes
but when I try saltLength: 0 or salt: Buffer.alloc(0), argon2 throws [Error: Salt is too short]
You can't, Argon2 does not support hashing without salt. The implementation of Argon2 expected in this document is not compliant with the reference one
It seems the documentation you sent is incorrect. This product uses libsodium and that requires a fixed salt length of 16 bytes. They simply initialize it with a zeroed buffer.
https://github.com/oxen-io/oxen-core/blob/7bda65c5d2f615c317682ee82cd8251d35a60b69/src/cryptonote_core/oxen_name_system.cpp#L1725-L1740
You likely can achieve the same hashes by passing { salt: Buffer.alloc(16) } as the second param for hash