Can a character somehow gain more, or less, hit dice than they have character levels?

I find the wording of regaining Hit Dice during a long rest very odd:

The character also regains spent Hit Dice, up to a number of dice equal to half of the character’s total number of them (minimum of one die). For example, if a character has eight Hit Dice, he or she can regain four spent Hit Dice upon finishing a long rest.

, when it could have simply been stated that a character regains spent Hit Dice up to half their level, minimum of one. Is there some corner cases where a character can have more or less Hit Dice than they have character levels?

Can name and date of birth be hashed somehow to generate a secure identifier?

I’m working on a project which we intend to launch for developing countries, and, as a result, want to limit the amount of information needed for login and identification, while still maintaining individual privacy and security.

Speaking to the team, it became clear that passwords are a no-go, as users may end up accessing the service only when they have a third-party providing the opportunity to access the internet (once or twice a year even). Remembering passwords, using emails, or anything of the sort would not work in that scenario.

The whole thing is I need to store some data about each user, and I don’t wanna have any idea whose data it is. It isn’t especially sensitive data, but I’m trying to build something that preserves privacy as much as possible.

I’m therefore wondering how to identify users with information they know and do not need to put any extra effort into remembering.

As a result, we’ve narrowed usable information down to: Full Name and Date of Birth (even DoB can be a problem for some). Intuitively, it doesn’t look like one could build something very secure with that data. One key flaw with name and DoB is that one can easily go through all combinations for “John Smith” with all possible dates of birth and find a matching hash.

Therefore, a rough solution we have in mind is to hash name and DoB and use as “username” (all happening in the background of course). Some additional measures would be to scramble the date of birth and add a salt to the hash.

The authentication would then happen via facial recognition. The idea is to encrypt a picture of the user with some combination of the name and DoB as well, so at least it isn’t as easily accessible to the database admin.

A user would log in only with their name, DoB and picture, in a system that would first search through the hashes until it finds a match, then decrypt the corresponding picture and compare the two pictures to allow login or not.

In summary, the user credentials would be something like:

SHA256(NAME + SCRAMBLED_DOB + SALT) => AES(PICTURE_DATA, (NAME+SCRAMBLED_DOB)) 

The salt could also be added to the encryption of the picture, such that, at login:

  1. All potential versions of the SCRAMBLED_DOB are tested with multiple salts until a hash contained in the database is found
  2. That specific hash and sequence of digits from the DoB found from Step 1 are used to decrypt the image
  3. Image is compared with the image submitted at login, which is then discarded

This process could get long, but depending on how long, it may be acceptable in the name of privacy.

So, essentially, what I’m wondering is:

  1. Would SHA256(NAME + SCRAMBLED_DOB + SALT) be safe enough, given the requirements of the project?
  2. Any suggestions for a better way to encrypt the picture?
  3. Any suggestions for this system overall?

Thanks in advance!

If a wildshaped druid somehow got Undead Fortitude, would this prevent them from reverting?

I believe this is completely outside the realms of RAW as I don’t know of any way for a PC to gain Undead Fortitude beside homebrew,

Undead Fortitude reads:

If damage reduces the creature to 0 hit points, it must make a Constitution saving throw with a DC of 5 + the damage taken, unless the damage is radiant or from a critical hit. On a success, the creature drops to 1 hit point instead.

and Wild Shape reads

You automatically revert if you fall unconscious, drop to 0 hit points, or die.

So with these two wordings, if you drop to 0 hit points while wildshaped, and since you retain any features from your race, while wildshaped, does that mean that Undead Fortitude could prevent a wildshaped druid from turning back into its non-beast form?

I somehow calculated 0=-1 I know I’m wrong but I need to know why I am wrong

This is my derivation n!/ (n-1)!= n . If I extend this derivation to negative integers ( I don’t know that I can extend it or not) then -1!/-2!=-1. If I take -1! as x and -2! as y then x/y=-1.From this I get x= -y. Now there is another factorial series or equation that I calculated somehow.This series or equation is n!/n-1= (n-1)!+(n-2)! ( I don’t know this equation already exists or not )now again if I extend this equation to negative integers ( again I don’t know I can extend this equation to negative integers or not) then 0!/-1=-1! + -2! which gives 1/-1= -1! + -2! which gives -1= -1! + -2! Now -1! = x and -2!= y so -1= x+y but from the first equation I already calculated x=-y so substituting for x in second equation I get -1= -y+y which gives -1 = 0 now my question is can I extend these basic equations of factorial which are valid for positive integers to negative factorial also ?and if no then why not ?

Is there a possibility to somehow overcome limitations of using generics in interface? (without boxing/unboxing)

I’m trying to create set of interfaces that will be used in several classes. But I have troubles with setting them properly. I want to keep them generic.

I tried to get around this using dynamic type and object type without success. Maybe this will be clear with attached those interfaces below:

In code below type T is unknown. I cannot specify it because each IDeviceParameter will be different type. And number of parameters is not fixed, so I want to simply add all available IParameters to list. Only solution that came into my mind is to use some sort of boxing/unboxing (for example cast int to object and vice versa) or use dynamic. Or to totally change those interfaces. Thanks you in advance for any advises.

public interface IDevice : IDisposable {     string Name { get; }     bool Close();     Guid DeviceGuid { get; }     IList<IDeviceParameter<T>>AvailableParameters { get; }     IList<IDeviceCommand> AvailableCommands { get; } }    public interface IDeviceParameter<T> {     event EventHandler<IDeviceParameter<T>> ParameterValueChanged;     event EventHandler<Exception> ParameterNotSet;     string ParameterName { get; }     string ParameterValue { get; }     string ParameterUnit { get; }     bool IsReadOnly { get; }     T Parameter { get; }     void SetParameter(T value); } 

Is there a possibility to somehow overcome limitations of using generics in interface? (without boxing/unboxing)

I’m trying to create set of interfaces that will be used in several classes. But I have troubles with setting them properly. I want to keep them generic.

I tried to get around this using dynamic type and object type without success. Maybe this will be clear with attached those interfaces below:

In code below type T is unknown. I cannot specify it because each IDeviceParameter will be different type. And number of parameters is not fixed, so I want to simply add all available IParameters to list. Only solution that came into my mind is to use some sort of boxing/unboxing (for example cast int to object and vice versa) or use dynamic. Or to totally change those interfaces. Thanks you in advance for any advises.

public interface IDevice : IDisposable {     string Name { get; }     bool Close();     Guid DeviceGuid { get; }     IList<IDeviceParameter<T>>AvailableParameters { get; }     IList<IDeviceCommand> AvailableCommands { get; } }    public interface IDeviceParameter<T> {     event EventHandler<IDeviceParameter<T>> ParameterValueChanged;     event EventHandler<Exception> ParameterNotSet;     string ParameterName { get; }     string ParameterValue { get; }     string ParameterUnit { get; }     bool IsReadOnly { get; }     T Parameter { get; }     void SetParameter(T value); } 

SD card is somehow read-only, from both Android and TWRP… how do I make it writable again?

My SD card is being weird.

I’m in TWRP, since a Lineage OS dirty flash (one without a wipe first) bricked my phone. Using the TWRP file manager, or the terminal, it doesn’t matter, moving files to it fails. Copying files to it fails. Deleting files from it fails. Formatting it fails. mkfs.ext2 from the terminal fails (vseek error). mkfs.fat doesn’t print any error, it may be returning a nonzero exit code but I can’t check. I’ve mounted and unmounted it multiple times, it doesn’t seem to help.

I’ve checked, and there’s no hardware switch on the SD card for read-only. Since it’s vfat, I’ve tried fsck.fat to no avail. Mounting it as rw didn’t really do anything, everything still fails (it was still mounted as rw afterwards, so it didn’t switch into read-only mode). All of that was tested from the terminal.

I’m not sure what’s going on. This is a perfectly reasonable SanDisk Ultra MicroSD card, that has worked before. Here’s the fsck output (I hit backspace on the first option, sorry for the ^H):

~ # fsck.fat /dev/lock/mmcblk1p1 fsck.fat 3.0.28 (2015-05-16) 0x41: Dirty bit is set. Fs was not properly unmounted and some data may be corrupt. 1) Remove dirty bit 2) No action ? 1^H2 FATs differ but appear to be intact. Use which FAT ? 1) Use first FAT 2) Use second FAT ? 1 Reclaimed 7 unused clusters (229376 bytes). Perform changes ? (y/n): y /dev/block/mmcblk1p1: 310 files, 7718/973584 clusters 

My particular phone is a Samsung Galaxy Note 3, Verizon variant. I just rooted it and want to try a clean flash of Lineage OS but I need the ROM on an SD card for that. Either that or I can start a Windows VM to flash a ROM like that.