Skip to content

Commit cae0bbf

Browse files
committed
feat(sqlite): add hashing, UUID, encoding and compression functions
Add the remaining crypto, UUID and encoding functions from the coverage audit (#586): SHA1, SHA2, UUID, UUID_SHORT, UUID_TO_BIN, BIN_TO_UUID, IS_UUID, RANDOM_BYTES, CRC32, CONV, OCT, BIN, BIT_COUNT, COMPRESS, UNCOMPRESS and UNCOMPRESSED_LENGTH. CONV uses an exact digit walk instead of base_convert(), which loses precision on large values, and COMPRESS follows MySQL's byte layout so the round trip through UNCOMPRESS and UNCOMPRESSED_LENGTH holds. Two platform limits shaped the implementation and are documented in the code: the PDO UDF bridge truncates integer returns to 32-bit signed, so UUID_SHORT and CRC32 return numeric strings rather than corrupting roughly half their range; and SQLite's LENGTH() stops at the first NUL byte of a binary result, so COMPRESS and RANDOM_BYTES output is measured with HEX() in the tests. Refs #586, #593.
1 parent 70bdaf3 commit cae0bbf

2 files changed

Lines changed: 926 additions & 0 deletions

File tree

0 commit comments

Comments
 (0)