Search Results for

    Show / Hide Table of Contents
    View Source

    Class HashCodeHelper

    Borrowed from http://stackoverflow.com/a/2575444/694494

    Inheritance
    System.Object
    Namespace: Umbraco.Cms.Core
    Assembly: Umbraco.Core.dll
    Syntax
    public static class HashCodeHelper

    Methods

    View Source

    CombineHashCode<T>(Int32, T)

    Alternative way to get a hashcode is to use a fluent interface like this:
    return 0.CombineHashCode(field1).CombineHashCode(field2). CombineHashCode(field3);

    Declaration
    public static int CombineHashCode<T>(this int hashCode, T arg)
    Parameters
    Type Name Description
    System.Int32 hashCode
    T arg
    Returns
    Type Description
    System.Int32
    Type Parameters
    Name Description
    T
    View Source

    GetHashCode<T>(T[])

    Declaration
    public static int GetHashCode<T>(T[] list)
    Parameters
    Type Name Description
    T[] list
    Returns
    Type Description
    System.Int32
    Type Parameters
    Name Description
    T
    View Source

    GetHashCode<T>(IEnumerable<T>)

    Declaration
    public static int GetHashCode<T>(IEnumerable<T> list)
    Parameters
    Type Name Description
    IEnumerable<T> list
    Returns
    Type Description
    System.Int32
    Type Parameters
    Name Description
    T
    View Source

    GetHashCode<T1, T2>(T1, T2)

    Declaration
    public static int GetHashCode<T1, T2>(T1 arg1, T2 arg2)
    Parameters
    Type Name Description
    T1 arg1
    T2 arg2
    Returns
    Type Description
    System.Int32
    Type Parameters
    Name Description
    T1
    T2
    View Source

    GetHashCode<T1, T2, T3>(T1, T2, T3)

    Declaration
    public static int GetHashCode<T1, T2, T3>(T1 arg1, T2 arg2, T3 arg3)
    Parameters
    Type Name Description
    T1 arg1
    T2 arg2
    T3 arg3
    Returns
    Type Description
    System.Int32
    Type Parameters
    Name Description
    T1
    T2
    T3
    View Source

    GetHashCode<T1, T2, T3, T4>(T1, T2, T3, T4)

    Declaration
    public static int GetHashCode<T1, T2, T3, T4>(T1 arg1, T2 arg2, T3 arg3, T4 arg4)
    Parameters
    Type Name Description
    T1 arg1
    T2 arg2
    T3 arg3
    T4 arg4
    Returns
    Type Description
    System.Int32
    Type Parameters
    Name Description
    T1
    T2
    T3
    T4
    View Source

    GetHashCodeForOrderNoMatterCollection<T>(IEnumerable<T>)

    Gets a hashcode for a collection for that the order of items does not matter. So {1, 2, 3} and {3, 2, 1} will get same hash code.

    Declaration
    public static int GetHashCodeForOrderNoMatterCollection<T>(IEnumerable<T> list)
    Parameters
    Type Name Description
    IEnumerable<T> list
    Returns
    Type Description
    System.Int32
    Type Parameters
    Name Description
    T
    • Improve this Doc
    • View Source
    In This Article
    • Methods
      • CombineHashCode<T>(Int32, T)
      • GetHashCode<T>(T[])
      • GetHashCode<T>(IEnumerable<T>)
      • GetHashCode<T1, T2>(T1, T2)
      • GetHashCode<T1, T2, T3>(T1, T2, T3)
      • GetHashCode<T1, T2, T3, T4>(T1, T2, T3, T4)
      • GetHashCodeForOrderNoMatterCollection<T>(IEnumerable<T>)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX