diff options
| author | Teddy Wing | 2018-11-09 15:24:39 +0100 |
|---|---|---|
| committer | Teddy Wing | 2018-11-09 15:37:43 +0100 |
| commit | 890c690007d55702d5eea9964e38e600bbc3dd15 (patch) | |
| tree | abf7689d1e7d8b9baeec96dca1e0ce8c6f80f97f /license-generator/Cargo.toml | |
| parent | 0a11429d59d0955ad19d798506b410cb7453b76e (diff) | |
| download | dome-key-web-890c690007d55702d5eea9964e38e600bbc3dd15.tar.bz2 | |
Purchaser: Add `generate_secret()` method
This new method generates a secret, which is a SHA1 digest of the
purchaser's name, email, and a random integer.
In order to use the `hexdigest()` method in the 'sha1' crate, I needed
to add the feature `std`
(https://docs.rs/sha1/0.6.0/sha1/struct.Sha1.html#method.hexdigest).
Needed to change the `secret` field to a `String` because otherwise the
generated digest string doesn't have a long enough lifetime to assign to
it.
Update `with_secret()` to use the new `String` type.
Update `insert()` to correctly handle the `Option` in `secret`.
Diffstat (limited to 'license-generator/Cargo.toml')
| -rw-r--r-- | license-generator/Cargo.toml | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/license-generator/Cargo.toml b/license-generator/Cargo.toml index d031794..89b54fa 100644 --- a/license-generator/Cargo.toml +++ b/license-generator/Cargo.toml @@ -6,6 +6,8 @@ version = "0.0.1" error-chain = "0.12.0" fastcgi = "1.0.0" mysql = "14.1.1" +rand = "0.5.5" +sha1 = { version = "0.6.0", features = ["std"] } [workspace] members = [ |
