CSMongo.Commands.MongoDatabaseCommands._HashString C# (CSharp) Method

_HashString() private static method

private static _HashString ( string value ) : string
value string
return string
        private static string _HashString(string value)
        {
            MD5 hash = MD5.Create();

            //hash the string into a new series of bytes
            byte[] bytes = Encoding.UTF8.GetBytes(value);
            byte[] hashed = hash.ComputeHash(bytes);

            //perform additional string formatting
            return BitConverter.ToString(hashed)
                .Replace("-", "")
                .ToLower();
        }