Closed samuela closed 3 months ago
I agree that example is deficient and doesn't fully explain everything you need to do for the generate
method to be available.
For more information, see the documentation here, note "available on crate feature rand_core
only":
https://docs.rs/ed25519-dalek/latest/ed25519_dalek/struct.SigningKey.html#method.generate
Solution: you need to enable the rand_core
crate feature in Cargo.toml:
[dependencies]
ed25519-dalek = { version = "2", features = ["rand_core"] }
Thanks @tarcieri ! That indeed solves the compilation error. I was not aware of the rand_core
option after reading https://docs.rs/ed25519-dalek/latest/ed25519_dalek/.
I will update the issue title to reflect a docs issue, instead of a compilation one.
I'm attempting to follow the documentation and have the following file:
which I'm attempting to build against ed25519_dalek 2.1.1 and rand 0.8.5 but I'm getting the following error: