GithubHelp home page GithubHelp logo

invio.hashing's People

Contributors

carusology avatar rokadias avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

invio.hashing's Issues

Update CI to use Solutions & Portable DebugTypes

Background
As part of our migration to v1.0.4 of the .NET SDK, I set the DebugType to full and updated the CI scripts to explicitly reference XML-based *.csproj files due to the removal of global.json and project.json. The DebugType really should be portable for .NET Core when we pack the code (though it needs to be full for when we run opencover on it), and we should add a *.sln to manage our *.csproj files.

Task

  • Update the repository to have a Invio.Hashing.sln solution at the root of the repository that references the source and test projects.
  • Update Invio.Hashing.Tests.csproj such that <IsPackable>false</IsPackable> is specified.
  • Restore set-debug-type.ps1, but with it updating the DebugType via the XML-based Invio.Hashing.csproj instead of JSON-based project.json.

Add `EqualityComparer` overloads to `HashCode.FromList()` and `HashCode.FromSet()`

If there are a list of values that you are generating a hash code for, you may want to calculate the hash code of those values using a specific IEqualityComparer implementation rather than use the object's default GetHashCode() implementation.

For example, you may want to use a case-insensitive string comparison for objects of type string, but the normal hash code for all other objects.

Add `IfStringComparer` IComparer implementation

Often I find myself in a situation where I have a list of objects that may contain strings. If there is a string, I want to do a case-insensitive equality/hash code comparison for each string found. Otherwise, use the default equals/hash code generation and comparison. I think this could best be solved by an IfStringComparer implementation that accepts objects instead of strings, and uses a predefined string comparison syntax for each string found, and the normal GetHashCode() implementation on all other objects (and a predefined constant for null - including null strings).

Add 'FromList' and 'FromSet' implementations

If we want to hash a list and maintain order, we need to implement our own hashing algorithm every time. If we want to hash a set and ignore order, we need to implement our own hashing algorithm every time.

I just wrote a bug in another repository because I incorrectly implemented my own hashing algorithm that we could solve once with a generic solution here. Let's do that instead.

NOTE: I don't think we need to update the main From implementation to do this by default for objects it can coerce as IEnumerable<T>, IList<T>, ISet<T>, et cetera. This is because I do not want to slow down the implementation with branches. I also believe it would make the hashing implementation too opinionated on what to do with a given IEnumerable (specifically: whether or not to respect order).

Update Travis CI to use .NET Core v1.1

Travis CI has not yet been updated to use .NET Core v1.1. Code coverage and deployment is performed via appveyor, so it is not a blocking issue. However, we will not be testing to make sure the library works on Linux / Mac OS X with Mono or .NET Core.

The underlying issue from Travis CI is here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.