ed25519 signature in NodeJs

I’m reading the documentation about using new ed25519 keys. The example is in Python and the documentation uses:

signature = base64.b64encode(private_key.sign(payload.encode('ASCII')))

How can I convert this line in NodeJs?
Thanks.

This code should be helpful with ed25519 key signature

1 Like