aboutsummaryrefslogtreecommitdiffstats
path: root/license-generator/src/errors.rs
diff options
context:
space:
mode:
authorTeddy Wing2018-11-09 15:24:39 +0100
committerTeddy Wing2018-11-09 15:37:43 +0100
commit890c690007d55702d5eea9964e38e600bbc3dd15 (patch)
treeabf7689d1e7d8b9baeec96dca1e0ce8c6f80f97f /license-generator/src/errors.rs
parent0a11429d59d0955ad19d798506b410cb7453b76e (diff)
downloaddome-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/src/errors.rs')
0 files changed, 0 insertions, 0 deletions