Example #1
0
        protected override byte[] GetIdentifierHash()
        {
            _traceManager?.TraceDebug("MachineMultiFootPrintIdentifierV2.GetIdentifierHash");

            var mbSerialNumber = MachineMultiFootPrintIdentifier.GetMBSerialNumber();

            _traceManager?.TraceDebug("MachineMultiFootPrintIdentifierV2.GetIdentifierHash : MBSerialNumber {0}", mbSerialNumber ?? String.Empty);

            var cpuID = MachineMultiFootPrintIdentifier.GetCPUSerialNumber();

            _traceManager?.TraceDebug("MachineMultiFootPrintIdentifierV2.GetIdentifierHash : CPUSerialNumber {0}", cpuID ?? String.Empty);

            var concat = string.Concat(
                mbSerialNumber,
                cpuID
                )
                         .Trim();

            _traceManager?.TraceDebug("MachineMultiFootPrintIdentifierV2.GetIdentifierHash : Concaténé {0}", concat ?? String.Empty);

            if (concat != null)
            {
                return(base.ComputeHash(concat));
            }
            else
            {
                return(null);
            }
        }
Example #2
0
        protected override byte[] GetIdentifierHash()
        {
            var dockerIsUsed = DockerHelper.IsInContainer();

            _traceManager?.TraceDebug("MachineMultiFootPrintIdentifierV3.GetIdentifierHash");

            var mbSerialNumber = dockerIsUsed ? "docker" : MachineMultiFootPrintIdentifier.GetMBSerialNumber();

            _traceManager?.TraceDebug("MachineMultiFootPrintIdentifierV3.GetIdentifierHash : MBSerialNumber {0}", mbSerialNumber ?? string.Empty);

            var cpuID = dockerIsUsed ? "docker" : MachineMultiFootPrintIdentifier.GetCPUSerialNumber();

            _traceManager?.TraceDebug("MachineMultiFootPrintIdentifierV3.GetIdentifierHash : CPUSerialNumber {0}", cpuID ?? string.Empty);

            var guid = GetGuid();

            _traceManager?.TraceDebug("MachineMultiFootPrintIdentifierV3.GetIdentifierHash : Guid {0}", guid);

            var concat = string.Join("$",
                                     mbSerialNumber,
                                     cpuID,
                                     guid.ToString(null, CultureInfo.InvariantCulture)
                                     )
                         .Trim();

            _traceManager?.TraceDebug("MachineMultiFootPrintIdentifierV3.GetIdentifierHash : Concaténé {0}", concat ?? string.Empty);

            if (concat != null)
            {
                return(ComputeHash(concat));
            }
            else
            {
                return(null);
            }
        }