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.
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'
}
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.
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.
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.