Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

Bitwise operators for bytea

Question posted by: Nick Johnson (Guest) on November 23rd, 2005 02:04 AM
Is there any particular reason there are no bitwise operators (I'm
looking for XOR, specifically) for the bytea data type? Any plans to
add them?

What I'm trying to do is store an SHA-1 hash in the database, and
create a trigger that runs on insert or update and updates a 'running
hash' record in another table by xoring it with the new (and in the
case of an update, old) hash. The best candidates are bytea, but that
has no xor operation, or bit(n), but there's no way to convert back to
hexadecimal from it.

Also, is there any particular reason sha1() is still not in PGSQL? I
know it's in pgcrypto, but shouldn't it be in main? MD5 is, and that's
now deprecated.

Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
 
Not the answer you were looking for? Post your question . . .
182,270 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

  • Didn't find the answer you were looking for?
    Post Your Question
  • Top Community Contributors