Will SHA1 or Other Hash Functions Ever Contain Quotes
SHA-1 (and, in general, any modern cryptographical method) will generate an arbitrary bitstring.  The bit string 0x22 (the ASCII code for double quote) is as probable as any other bitstring.

You could attempt to detect (and escape) such byte values; another possibility is convert the bitstring into hex or base-64; those have a deterministic size, and may be a bit easier to place into the database.