GPU in docker, possible?

Yes, it seems like there won’t be anything else I need to do to the Dockerfile: just that settings will need to get tweaked. See

PhotoStructure uses hashes everywhere: it even hashes files post-copy to verify the OS isn’t lying to PhotoStructure (which it does sometimes on remote filesystems), so any improvement would be great.

I got excited about new hashing algos a while back, but I didn’t test blake2 (as it wasn’t in the lowest node I was supporting), but v1.0.0 is going to require node 14.15.5+, and that includes ‘blake2b512’,
and ‘blake2s256’. :+1: I’ll check that when I get a chance.

Switching secure hash algos would require a brand-new library, btw. Bad things would happen if the hash algo was changed mid-flight during an import.

Here were my old hashing notes:

// Secure hash research:

// SHA1 has known collisions. It should be expected for a nerd to have sample
// images that collide on their laptop.

// SHA2 224 and 256 uses 32 bit operations. SHA-512/224 provides length
// protection and is 20-50% faster than SHA224 on 64 bit hardware, but NodeJS’
// crypto only supports SHA-512 (not the SHA-512/224 or SHA-512/256 variant),
// which is simply SHA-512’s leftmost N bits with a different initialization
// vector.

// I don’t see why these SHA values would need to be externally consumed, so
// people shouldn’t care if the SHA in the db isn’t a FIPS standard. I don’t
// want to pull in another native library dependency if I can help it.

// ALSO: I don’t need that many bits to ensure uniqueness! 160 was enough for
// SHA1, 192 should be plenty, and only takes 32 base64 characters (and doesn’t
// waste chars on padding).

// HOWEVER: versions pre-v0.3.5 used the most significant 224 bits, so when we
// build SHAs of strings (like for volume UIDs), we maintain backward
// compatibility by slicing MSB 224 bits. If we slice 192 bits and we use a
// non-8-bit-divisible radix, the values change.

// See SHA-2 is fine, and in fact the more conservative choice right now. SHA-3 didn't ... | Hacker News

// shasum -a 512224 implements SHA-512/224.
// shasum -a 512256 implements SHA-512/256.