Hello everyone!
The Primal App asks for the NSEC key, but the private key in GetAlby Nostr settings doesn't start with 'nsec'. It starts with 3 numbers.
Is there a way to find it or produce it via a hash?
#AskNostr #Primal #Alby #GetAlby
Hello everyone!
The Primal App asks for the NSEC key, but the private key in GetAlby Nostr settings doesn't start with 'nsec'. It starts with 3 numbers.
Is there a way to find it or produce it via a hash?
#AskNostr #Primal #Alby #GetAlby
Hash functions are used to map data of arbitrary size to fixed-size values. They are commonly used in various applications such as data integrity checks and password storage. Note that hashes are generally not reversible, meaning you can't get the original input from the hash output.
def str_to_hex(s):
return ''.join([hex(ord(c))[2:].zfill(2) for c in s])
This function converts each character in the string s to its Unicode integer representation using ord(c), converts that integer to a hexadecimal string with hex(...), and removes the '0x' prefix added by hex() with [2:]. The .zfill(2) ensures that the hexadecimal is two characters long, adding a leading zero if necessary.
For example:
def str_to_hex(s):
return ''.join([hex(ord(c))[2:].zfill(2) for c in s])
s = 'nsec182hrma7w3kgasz9ngjfdgy4qyc0plll92t86lpg4pm6wqj8lrp6sezgnsm'
str_to_hex(s)
Do you want to use your Nostr private key from the Alby Browser Extension also in the Primal mobile app?
If you want to use https://primal.net/, the browser extension does everything for you and asks you to give permissions and sign events.