Giter VIP home page Giter VIP logo

csharp-diceware's Introduction

C# Diceware - Human-friendly hashes

This is a CSharp (.NET Core) Diceware library, commonly known as 'human friendly hashes'.

It takes a string (e.g. a hash) and converts it to a phrase according to a specific format.

It's not available on nuget at this time, but simply copying the .cs files from this repo into a folder, and then using Diceware; should be sufficient.

This library is literally a translation from the JS library 'hashwords' (https://github.com/jjt/hashwords)

There's a few diceware / human-friendly-hash libs already out there for C#, but none of them allowed you to control the input.

This is a 1-way function, and it is not possible to get the original hash back from a diceware hash generated by this library. With that said, I make no promises about it's cryptographic security.

Usage

using Diceware;

public string GenerateDicewareString(){
    Diceware.Diceware DW = new Diceware.Diceware();
    return DW.GenerateDicewareString("WEAR_A_MASK", "adj adj noun animal", 8);

    // Returns 4 words which are at least 8 characters in length in the format 'adjective adjective noun animal'
}

Use cases

If you're generating a hash based upon defined unique values (e.g. a hardware device serial number), this library takes that hash that you'll probably never remember, and turns it into something you will remember.

Why?

I was attempting to rewrite a node project in C#, for fun, to see if it was possible, and to help practice my C#. Part of that project needed the functionality provided here. No C# library with this functionality existed already, so I converted an existing JS library.

PR's?

By all means, open a PR. I can't promise that I'll be watching for PR's to this repo or that they'll be merged.

Fork the library and adapt it. Use it freely.

csharp-diceware's People

Contributors

chronsyn avatar

Watchers

 avatar

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.