Struct machineid_rs::IdBuilder [−][src]
pub struct IdBuilder {
pub hash: Encryption,
// some fields omitted
}Expand description
IdBuilder is the constructor for the HWID. It can be used with the 3 different options of the Encryption enum.
Fields
hash: EncryptionImplementations
Joins every part together and returns a Result that may be the hashed HWID or a HWIDError.
Errors
Returns Err if there is an error while retrieving the component’s strings.
Examples
use machineid_rs::{IdBuilder, Encryption, HWIDComponent};
let mut builder = IdBuilder::new(Encryption::MD5);
builder.add_component(HWIDComponent::SystemID);
// Will panic if there is an error when the components return his values.
let key = builder.build("mykey").unwrap();Adds a component to the IdBuilder that will be hashed once you call the IdBuilder::build function.
You can’t add the same component twice.
Examples
use machineid_rs::{IdBuilder, Encryption, HWIDComponent};
let mut builder = IdBuilder::new(Encryption::MD5);
builder.add_component(HWIDComponent::SystemID);Makes a new IdBuilder with the selected Encryption
Examples
use machineid_rs::{IdBuilder, Encryption};
let mut builder = IdBuilder::new(Encryption::MD5);