跳转到主要内容

hashtypes

包括SHA1,MD5在内的多种哈希数据类型

hashtypes · 包括SHA1,MD5在内的多种哈希数据类型

概览

ID扩展软件包版本类别许可证编程语言
3770hashtypeshashtypes0.1.5TYPEPostgreSQLC
属性可执行文件动态库需要预加载需要建扩展可迁移可信
--s-d--否是否是否否

软件包

类型仓库版本兼容的 PostgreSQL 大版本包名模式依赖
EXTPIGSTY0.1.519 18 17 16 15hashtypes-
RPMPIGSTY0.1.519 18 17 16 15hashtypes_$v-
DEBPIGSTY0.1.519 18 17 16 15postgresql-$v-hashtypes-
Linux / PGPG19PG18PG17PG16PG15
el8.x86_64N/APIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5
el8.aarch64N/APIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5
el9.x86_64PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5
el9.aarch64PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5
el10.x86_64PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5
el10.aarch64PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5
d12.x86_64PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5
d12.aarch64PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5
d13.x86_64PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5
d13.aarch64PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5
u22.x86_64PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5
u22.aarch64PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5
u24.x86_64PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5
u24.aarch64PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5
u26.x86_64PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5
u26.aarch64PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5PIGSTY 0.1.5
软件包版本平台仓库大小下载
hashtypes_190.1.5el9.x86_64pigsty45.1 KiBhashtypes_19-0.1.5-1PGSTY.el9.x86_64.rpm
hashtypes_190.1.5el9.aarch64pigsty44.4 KiBhashtypes_19-0.1.5-1PGSTY.el9.aarch64.rpm
hashtypes_190.1.5el10.x86_64pigsty44.9 KiBhashtypes_19-0.1.5-1PGSTY.el10.x86_64.rpm
hashtypes_190.1.5el10.aarch64pigsty45.0 KiBhashtypes_19-0.1.5-1PGSTY.el10.aarch64.rpm
postgresql-19-hashtypes0.1.5d12.x86_64pigsty33.6 KiBpostgresql-19-hashtypes_0.1.5-1PGSTY~bookworm_amd64.deb
postgresql-19-hashtypes0.1.5d12.aarch64pigsty33.6 KiBpostgresql-19-hashtypes_0.1.5-1PGSTY~bookworm_arm64.deb
postgresql-19-hashtypes0.1.5d13.x86_64pigsty33.7 KiBpostgresql-19-hashtypes_0.1.5-1PGSTY~trixie_amd64.deb
postgresql-19-hashtypes0.1.5d13.aarch64pigsty33.7 KiBpostgresql-19-hashtypes_0.1.5-1PGSTY~trixie_arm64.deb
postgresql-19-hashtypes0.1.5u22.x86_64pigsty35.9 KiBpostgresql-19-hashtypes_0.1.5-1PGSTY~jammy_amd64.deb
postgresql-19-hashtypes0.1.5u22.aarch64pigsty35.4 KiBpostgresql-19-hashtypes_0.1.5-1PGSTY~jammy_arm64.deb
postgresql-19-hashtypes0.1.5u24.x86_64pigsty35.1 KiBpostgresql-19-hashtypes_0.1.5-1PGSTY~noble_amd64.deb
postgresql-19-hashtypes0.1.5u24.aarch64pigsty35.3 KiBpostgresql-19-hashtypes_0.1.5-1PGSTY~noble_arm64.deb
postgresql-19-hashtypes0.1.5u26.x86_64pigsty35.0 KiBpostgresql-19-hashtypes_0.1.5-1PGSTY~resolute_amd64.deb
postgresql-19-hashtypes0.1.5u26.aarch64pigsty35.2 KiBpostgresql-19-hashtypes_0.1.5-1PGSTY~resolute_arm64.deb
软件包版本平台仓库大小下载
hashtypes_180.1.5el8.x86_64pigsty44.0 KiBhashtypes_18-0.1.5-1PGSTY.el8.x86_64.rpm
hashtypes_180.1.5el8.aarch64pigsty43.8 KiBhashtypes_18-0.1.5-1PGSTY.el8.aarch64.rpm
hashtypes_180.1.5el9.x86_64pigsty45.0 KiBhashtypes_18-0.1.5-1PGSTY.el9.x86_64.rpm
hashtypes_180.1.5el9.aarch64pigsty44.4 KiBhashtypes_18-0.1.5-1PGSTY.el9.aarch64.rpm
hashtypes_180.1.5el10.x86_64pigsty44.9 KiBhashtypes_18-0.1.5-1PGSTY.el10.x86_64.rpm
hashtypes_180.1.5el10.aarch64pigsty45.0 KiBhashtypes_18-0.1.5-1PGSTY.el10.aarch64.rpm
postgresql-18-hashtypes0.1.5d12.x86_64pigsty33.7 KiBpostgresql-18-hashtypes_0.1.5-1PGSTY~bookworm_amd64.deb
postgresql-18-hashtypes0.1.5d12.aarch64pigsty33.6 KiBpostgresql-18-hashtypes_0.1.5-1PGSTY~bookworm_arm64.deb
postgresql-18-hashtypes0.1.5d13.x86_64pigsty33.7 KiBpostgresql-18-hashtypes_0.1.5-1PGSTY~trixie_amd64.deb
postgresql-18-hashtypes0.1.5d13.aarch64pigsty33.8 KiBpostgresql-18-hashtypes_0.1.5-1PGSTY~trixie_arm64.deb
postgresql-18-hashtypes0.1.5u22.x86_64pigsty35.9 KiBpostgresql-18-hashtypes_0.1.5-1PGSTY~jammy_amd64.deb
postgresql-18-hashtypes0.1.5u22.aarch64pigsty35.4 KiBpostgresql-18-hashtypes_0.1.5-1PGSTY~jammy_arm64.deb
postgresql-18-hashtypes0.1.5u24.x86_64pigsty35.2 KiBpostgresql-18-hashtypes_0.1.5-1PGSTY~noble_amd64.deb
postgresql-18-hashtypes0.1.5u24.aarch64pigsty35.2 KiBpostgresql-18-hashtypes_0.1.5-1PGSTY~noble_arm64.deb
postgresql-18-hashtypes0.1.5u26.x86_64pigsty35.0 KiBpostgresql-18-hashtypes_0.1.5-1PGSTY~resolute_amd64.deb
postgresql-18-hashtypes0.1.5u26.aarch64pigsty35.2 KiBpostgresql-18-hashtypes_0.1.5-1PGSTY~resolute_arm64.deb
软件包版本平台仓库大小下载
hashtypes_170.1.5el8.x86_64pigsty44.0 KiBhashtypes_17-0.1.5-1PGSTY.el8.x86_64.rpm
hashtypes_170.1.5el8.aarch64pigsty43.8 KiBhashtypes_17-0.1.5-1PGSTY.el8.aarch64.rpm
hashtypes_170.1.5el9.x86_64pigsty45.0 KiBhashtypes_17-0.1.5-1PGSTY.el9.x86_64.rpm
hashtypes_170.1.5el9.aarch64pigsty44.4 KiBhashtypes_17-0.1.5-1PGSTY.el9.aarch64.rpm
hashtypes_170.1.5el10.x86_64pigsty44.9 KiBhashtypes_17-0.1.5-1PGSTY.el10.x86_64.rpm
hashtypes_170.1.5el10.aarch64pigsty45.0 KiBhashtypes_17-0.1.5-1PGSTY.el10.aarch64.rpm
postgresql-17-hashtypes0.1.5d12.x86_64pigsty33.7 KiBpostgresql-17-hashtypes_0.1.5-1PGSTY~bookworm_amd64.deb
postgresql-17-hashtypes0.1.5d12.aarch64pigsty33.6 KiBpostgresql-17-hashtypes_0.1.5-1PGSTY~bookworm_arm64.deb
postgresql-17-hashtypes0.1.5d13.x86_64pigsty33.7 KiBpostgresql-17-hashtypes_0.1.5-1PGSTY~trixie_amd64.deb
postgresql-17-hashtypes0.1.5d13.aarch64pigsty33.7 KiBpostgresql-17-hashtypes_0.1.5-1PGSTY~trixie_arm64.deb
postgresql-17-hashtypes0.1.5u22.x86_64pigsty36.5 KiBpostgresql-17-hashtypes_0.1.5-1PGSTY~jammy_amd64.deb
postgresql-17-hashtypes0.1.5u22.aarch64pigsty36.0 KiBpostgresql-17-hashtypes_0.1.5-1PGSTY~jammy_arm64.deb
postgresql-17-hashtypes0.1.5u24.x86_64pigsty35.1 KiBpostgresql-17-hashtypes_0.1.5-1PGSTY~noble_amd64.deb
postgresql-17-hashtypes0.1.5u24.aarch64pigsty35.2 KiBpostgresql-17-hashtypes_0.1.5-1PGSTY~noble_arm64.deb
postgresql-17-hashtypes0.1.5u26.x86_64pigsty35.0 KiBpostgresql-17-hashtypes_0.1.5-1PGSTY~resolute_amd64.deb
postgresql-17-hashtypes0.1.5u26.aarch64pigsty35.2 KiBpostgresql-17-hashtypes_0.1.5-1PGSTY~resolute_arm64.deb
软件包版本平台仓库大小下载
hashtypes_160.1.5el8.x86_64pigsty44.0 KiBhashtypes_16-0.1.5-1PGSTY.el8.x86_64.rpm
hashtypes_160.1.5el8.aarch64pigsty43.8 KiBhashtypes_16-0.1.5-1PGSTY.el8.aarch64.rpm
hashtypes_160.1.5el9.x86_64pigsty45.0 KiBhashtypes_16-0.1.5-1PGSTY.el9.x86_64.rpm
hashtypes_160.1.5el9.aarch64pigsty44.4 KiBhashtypes_16-0.1.5-1PGSTY.el9.aarch64.rpm
hashtypes_160.1.5el10.x86_64pigsty44.9 KiBhashtypes_16-0.1.5-1PGSTY.el10.x86_64.rpm
hashtypes_160.1.5el10.aarch64pigsty45.0 KiBhashtypes_16-0.1.5-1PGSTY.el10.aarch64.rpm
postgresql-16-hashtypes0.1.5d12.x86_64pigsty33.6 KiBpostgresql-16-hashtypes_0.1.5-1PGSTY~bookworm_amd64.deb
postgresql-16-hashtypes0.1.5d12.aarch64pigsty33.6 KiBpostgresql-16-hashtypes_0.1.5-1PGSTY~bookworm_arm64.deb
postgresql-16-hashtypes0.1.5d13.x86_64pigsty33.7 KiBpostgresql-16-hashtypes_0.1.5-1PGSTY~trixie_amd64.deb
postgresql-16-hashtypes0.1.5d13.aarch64pigsty33.8 KiBpostgresql-16-hashtypes_0.1.5-1PGSTY~trixie_arm64.deb
postgresql-16-hashtypes0.1.5u22.x86_64pigsty36.5 KiBpostgresql-16-hashtypes_0.1.5-1PGSTY~jammy_amd64.deb
postgresql-16-hashtypes0.1.5u22.aarch64pigsty36.0 KiBpostgresql-16-hashtypes_0.1.5-1PGSTY~jammy_arm64.deb
postgresql-16-hashtypes0.1.5u24.x86_64pigsty35.2 KiBpostgresql-16-hashtypes_0.1.5-1PGSTY~noble_amd64.deb
postgresql-16-hashtypes0.1.5u24.aarch64pigsty35.2 KiBpostgresql-16-hashtypes_0.1.5-1PGSTY~noble_arm64.deb
postgresql-16-hashtypes0.1.5u26.x86_64pigsty35.0 KiBpostgresql-16-hashtypes_0.1.5-1PGSTY~resolute_amd64.deb
postgresql-16-hashtypes0.1.5u26.aarch64pigsty35.2 KiBpostgresql-16-hashtypes_0.1.5-1PGSTY~resolute_arm64.deb
软件包版本平台仓库大小下载
hashtypes_150.1.5el8.x86_64pigsty44.1 KiBhashtypes_15-0.1.5-1PGSTY.el8.x86_64.rpm
hashtypes_150.1.5el8.aarch64pigsty44.1 KiBhashtypes_15-0.1.5-1PGSTY.el8.aarch64.rpm
hashtypes_150.1.5el9.x86_64pigsty45.0 KiBhashtypes_15-0.1.5-1PGSTY.el9.x86_64.rpm
hashtypes_150.1.5el9.aarch64pigsty44.7 KiBhashtypes_15-0.1.5-1PGSTY.el9.aarch64.rpm
hashtypes_150.1.5el10.x86_64pigsty44.9 KiBhashtypes_15-0.1.5-1PGSTY.el10.x86_64.rpm
hashtypes_150.1.5el10.aarch64pigsty45.0 KiBhashtypes_15-0.1.5-1PGSTY.el10.aarch64.rpm
postgresql-15-hashtypes0.1.5d12.x86_64pigsty33.7 KiBpostgresql-15-hashtypes_0.1.5-1PGSTY~bookworm_amd64.deb
postgresql-15-hashtypes0.1.5d12.aarch64pigsty33.6 KiBpostgresql-15-hashtypes_0.1.5-1PGSTY~bookworm_arm64.deb
postgresql-15-hashtypes0.1.5d13.x86_64pigsty33.8 KiBpostgresql-15-hashtypes_0.1.5-1PGSTY~trixie_amd64.deb
postgresql-15-hashtypes0.1.5d13.aarch64pigsty33.6 KiBpostgresql-15-hashtypes_0.1.5-1PGSTY~trixie_arm64.deb
postgresql-15-hashtypes0.1.5u22.x86_64pigsty36.9 KiBpostgresql-15-hashtypes_0.1.5-1PGSTY~jammy_amd64.deb
postgresql-15-hashtypes0.1.5u22.aarch64pigsty36.2 KiBpostgresql-15-hashtypes_0.1.5-1PGSTY~jammy_arm64.deb
postgresql-15-hashtypes0.1.5u24.x86_64pigsty35.2 KiBpostgresql-15-hashtypes_0.1.5-1PGSTY~noble_amd64.deb
postgresql-15-hashtypes0.1.5u24.aarch64pigsty35.1 KiBpostgresql-15-hashtypes_0.1.5-1PGSTY~noble_arm64.deb
postgresql-15-hashtypes0.1.5u26.x86_64pigsty34.9 KiBpostgresql-15-hashtypes_0.1.5-1PGSTY~resolute_amd64.deb
postgresql-15-hashtypes0.1.5u26.aarch64pigsty35.2 KiBpostgresql-15-hashtypes_0.1.5-1PGSTY~resolute_arm64.deb

源码

pig build pkg hashtypes;		# build rpm/deb

安装

启用 PGDG 和 PIGSTY 仓库并更新缓存。

pig repo add pgsql -u   # add both repo and update cache

使用 pig 安装扩展。

pig install hashtypes;		# install by package name

pig install hashtypes -v 19;   # install for PG 19
pig install hashtypes -v 18;   # install for PG 18
pig install hashtypes -v 17;   # install for PG 17
pig install hashtypes -v 16;   # install for PG 16
pig install hashtypes -v 15;   # install for PG 15

在数据库中创建扩展。

CREATE EXTENSION hashtypes;

用法

hashtypes: 哈希与校验和数据类型(SHA、CRC32)

hashtypes 扩展提供了原生数据类型,用于以二进制形式存储哈希值和校验和,相比文本存储更节省空间。

CREATE EXTENSION hashtypes;

数据类型

类型存储大小描述
sha120 字节SHA-1 哈希(160 位)
sha22428 字节SHA-224 哈希(224 位)
sha25632 字节SHA-256 哈希(256 位)
sha38448 字节SHA-384 哈希(384 位)
sha51264 字节SHA-512 哈希(512 位)
crc324 字节CRC-32 校验和

用法

CREATE TABLE objects (
    hash sha256 PRIMARY KEY,
    data bytea
);

INSERT INTO objects VALUES (
    'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855',
    '\x'
);

SELECT * FROM objects WHERE hash = 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855';

运算符

所有类型均支持比较运算符:=、<>、<、>、<=、>=。

索引支持

所有类型均提供 Btree 和 Hash 索引运算符类。

类型转换

所有类型均支持与 text 和 bytea 之间的双向转换。

表格阅读器