Avatar
Perlover
0d3f0394b117eee4832bd31ee415733d0386928c7daae05525483ff8c9eb046b
Lightning & Bitcoin Maximalist ;-) openpgp4fpr:8f63e103a538fc16222d5ff44c3fc769514425bc

But 280 and 50 are very similar to how the length of bytes to a string correlates with utf-8. For the largest character with 32 bits, 6 bytes are needed. Maybe you took this piece of code with such an original meaning somewhere?

If possible - a wish. It would be better if the public key and the private one could be set in bech32 encoding with prefixes. Firstly, the user will not confuse the private key with the public one by mistake and will not accidentally reveal it. Also, he will not have to look for decoders, since many Nostr clients give the user already encoded bech32 keys. This also reduces the risk of private key leakage through decoders. In addition, you already use the bech32 functions for encoding - there is already the same module for decoding.

May be it's because "length" returns in bytes but you want a length of utf-8 characters? But your test doesn't take an account for latin letters - I can send 280 characters.

In you code "commentAllowed" equal 50 but in the checking sent comment you have a max 280 length. May be there is mistake?

#[0] #[1] It seems to me that such a feature will be useful to many: in the menu for each note (where there are three dots), make "Save to yourself" - when you click, Amethyst automatically sends the record ID to itself as a personal encrypted message.

Couldn't help but send ZAP :)))

Replying to Avatar pingstahu

MM

Hello! Did you mean "GM" may be? :) Because "MM" has another meaning...

I am nobody and my answer is noanswer :)