SDKs
...
Hardware ID generation
Legacy algorithms
8 min
before standardizing the hardware id algorithms, different licensespring sdks used to compute slightly different hardware ids each platform that sdks run on had a default algorithms and alternative algorithms default algorithm windows default hardware id algorithm uses wmi to fetch model, manufacturer, name, serialnumber of the motherboard, processor and the system disk afterwards, it encodes them to provide a unique string that represents the current device linux default device id reads the machine id from the /etc/machine id file this file contains the unique machine id of the local system that is set during installation or boot if this id is not found, it tries to read the /var/lib/dbus/machine id file if it still fails to get the id, it writes a generated uuid macos the c++ sdk uses the gethostuuid() system call to get a unique identifier of the device the net sdk gets ioplatformuuid value the swift sdk gets the machine uuid ios the swift sdk gets uidevice current identifierforvendor windows algorithms c++ sdk gen2 algorithm is similar to the default algorithm it is safer and shorter than default this algorithm retrieves the manufacturer and serialnumber of the motherboard, cpu name and id, and disc model and serial number this algorithm can be useful for air gap licenses wincsproductid is an alternative algorithm for windows it gets the uuid of the windows machine using computer system product id through wmi wincryptographyid is an algorithm for windows that doesn't use wmi it gets microsoft cryptography machineguid from windows registry net sdk gen1 includes minor improvements for id calculation on windows, on other platforms the same as default gen2 and gen3 are safer device id algorithms on windows, on other platforms the same as default gen3 is a shorter form that can be useful for air gap licenses winalternative algorithm tries to get microsoft cryptography machineguid from windows registry if this request fails or net framework version is earlier than 4 0, it tries to get the uuid of the windows machine using computer system product id cloud platform algorithms cloudplatformsid is useful when the software runs on azure , aws or gcp it is a good option when the application will be used only on these platforms if the application can be installed on other platforms as well, the autoid algorithm should be used autoid uses different approaches depending on your platform if the application is running on azure, aws or gcp, it is the same as cloudplatformsid , otherwise the same as default autoidwincloud also uses different platform dependent approaches if the application is running on azure, aws or gcp, it is the same as cloudplatformsid , otherwise the same as wincsproductid this algorithm should only be used on windows computers hardware id usage configuration after choosing an algorithm, set it in extendedoptions or licensespringconfiguration licensespring extendedoptions options; options setdeviceidalgorithm(autoid);var options = new extendedoptions(); options deviceidalgorithm = deviceidalgorithm autoid;configuration hardwareid = generatemyowncustomid()licensespringconfiguration config = licensespringconfiguration builder() identityprovider(hardwareidstrategy auto hardware id) build(); the net sdk allows to specify the timeout for cloud platforms id id requests it is useful when autoid takes too long on a regular machine this value is specified in milliseconds, the default is 200 options cloudidrequesttimeout = 100; the sdk allows overriding hardware id for instance, you can use the mac address as the hardware id licensespring extendedoptions options; options sethardwareid(options getnetworkinfo() mac());var configuration = new licensespring configuration(); var options = new licensespring extendedoptions(); options hardwareid = configuration macaddress; configuration extendedoptions = options;// go sdk v2 lm config = license manager licensemanagerbasicconfiguration{ 	 oauth false, 	 apikey "your api key", 	 sharedkey "your shared key", 	 productcode "your product code", 	 authdata auth fromkey("license key"), 	 } lm, = license manager newlicensemanager( lm config, license manager withhardwareid("your hw id"), )licensespringconfiguration config = licensespringconfiguration builder() identityprovider(customidentityprovider) build();