Click or drag to resize

SKMgetMachineCode Method

This method will calculate a machine code

Namespace:  SKGL
Assembly:  SKM (in SKM.dll) Version: (
public static string getMachineCode(
	Func<string, string> hashFunction,
	bool includeUserName = false


Type: SystemFuncString, String
The hash function that is to be used. getEightDigitLongHash or SHA1 can be used as a default hash function.
includeUserName (Optional)
Type: SystemBoolean
If set to TRUE, the user name of the current user will be added into the

Return Value

Type: String
A machine code
Machine code can be calculated with the function below. Any other hash algorithm will do, as long as it only contains letters and digits only.
'eg. "61843235" (getEightDigitsLongHash)
'eg. "D38F13CAB8938AC3C393BC111E1A85BB4BA2CCC9" (getSHA1)
Dim machineCode = SKGL.SKM.getMachineCode(AddressOf SKGL.SKM.getEightDigitsLongHash)
Dim machineCode = SKGL.SKM.getMachineCode(AddressOf SKGL.SKM.getSHA1)
//eg. "61843235" (getEightDigitsLongHash)
//eg. "D38F13CAB8938AC3C393BC111E1A85BB4BA2CCC9" (getSHA1)
string machineID1 = SKGL.SKM.getMachineCode(SKGL.SKM.getEightDigitsLongHash);
string machineID2 = SKGL.SKM.getMachineCode(SKGL.SKM.getSHA1);
See Also