aboutsummaryrefslogtreecommitdiff
path: root/examples
Commit message (Collapse)AuthorAge
* Represent serial numbers using SerialNumber structRobin Krahl2020-02-03
| | | | | | | | | | | | | | | | | In a previous commit, we changed the serial number representation from a string to an integer. This made it easier to compare serial numbers, but also introduced new problems: - Serial numbers should be formatted consistently, for example as "{:#010x}". It is hard to ensure this for an integer value. - The format of the serial number may be subject to change. Users should not rely too much on the u32 representation. Therefore we introduce a new SerialNumber struct that represents a serial number. Currently it only stores a u32 value. The following traits and functions can be used to access its value: - FromStr for string parsing - ToString/Display for string formatting - as_u32 to access the underlying integer value
* Fix license identifier in examples/*.rsRobin Krahl2020-01-14
| | | | | This patch replaces the invalid license identifier CC-0 with the correct identifier CC0-1.0.
* Add basic usage examplesRobin Krahl2020-01-14
This patch adds two basic usage examples: listing and connecting to Nitrokey devices, and generating a one-time password.