This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- crc32c https://tools.ietf.org/html/rfc3385#section-4.1 | |
-- Table-based crc32 (not exactly right algorithm, but a good pattern to follow) | |
-- https://gist.github.com/cuber/bcf0a3a96fc9a790d96d | |
-- Google-created CRC table | |
-- https://github.com/googlearchive/crc32c-java/blob/master/src/com/google/cloud/Crc32c.java | |
CREATE OR REPLACE FUNCTION update_crc32c(src TEXT, | |
crc BIGINT DEFAULT 0) | |
RETURNS BIGINT | |
LANGUAGE plpgsql IMMUTABLE PARALLEL SAFE AS | |
$$ |