Backported https://github.com/joshdick/Chroma-Hash/commit/31a17f5e04dad879cc35af38ad689cfa48a9dbcd