parent
b45370e65f
commit
bba18d1bc0
@ -36,6 +36,7 @@ keys and public keys
|
|||||||
- Fixed the return type of `Nostr::Crypto#decrypt_text` when given an invalid ciphertext
|
- Fixed the return type of `Nostr::Crypto#decrypt_text` when given an invalid ciphertext
|
||||||
- Fixed the RBS type of `Nostr::Filter#to_h`, `Nostr::Filter#e` and `Nostr::Filter#p`
|
- Fixed the RBS type of `Nostr::Filter#to_h`, `Nostr::Filter#e` and `Nostr::Filter#p`
|
||||||
- Fixed the RBS types of `EventEmitter` and `EventMachine::Channel`
|
- Fixed the RBS types of `EventEmitter` and `EventMachine::Channel`
|
||||||
|
- Fixed the generation of private keys
|
||||||
|
|
||||||
## [0.4.0] - 2023-02-25
|
## [0.4.0] - 2023-02-25
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ module Nostr
|
|||||||
# @return [PrivateKey] A 32-bytes hex-encoded private key.
|
# @return [PrivateKey] A 32-bytes hex-encoded private key.
|
||||||
#
|
#
|
||||||
def generate_private_key
|
def generate_private_key
|
||||||
hex_value = (SecureRandom.random_number(group.order - 1) + 1).to_s(16)
|
hex_value = (SecureRandom.random_number(group.order - 1) + 1).to_s(16).rjust(64, '0')
|
||||||
PrivateKey.new(hex_value)
|
PrivateKey.new(hex_value)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user