SharpSoundDevice.DeviceUtilities.GenerateIntegerId C# (CSharp) Method

GenerateIntegerId() public static method

Generates a 4-byte integer by hashing an input string and taking modulus. Useful to create VST Id that is unique to your plugin
public static GenerateIntegerId ( string seedString ) : int
seedString string input string, e.g. plugin and developer name
return int
        public static int GenerateIntegerId(string seedString)
        {
            var bytes = Encoding.UTF8.GetBytes(seedString);
            SHA256Managed hashstring = new SHA256Managed();
            byte[] hash = hashstring.ComputeHash(bytes);
            var bignum = BitConverter.ToUInt64(hash, 4);
            return (Int32)(bignum % Int32.MaxValue);
        }