Method: EC::PrivateKey#to_s
- Defined in:
- lib/elliptic/private_key.rb
#to_s ⇒ Object
todo/check/fix: make it always a 32 byte (64 hex chars) string
even with leading zeros !!! - why? why not?
todo/check - add hex alias - why? why not?
54 55 56 57 |
# File 'lib/elliptic/private_key.rb', line 54 def to_s ## todo/fix: use number of bytes depending on curve (e.g. secp256k1 = 32-byte/256-bit) @pkey.private_key.to_i.to_s(16).rjust(64, '0'); # convert to hex and make sure it's 32 bytes (64 characters) end |