除了 kdb+ 上的 MD5 之外,是否还有其他原生哈希方法,例如 SHA1/256?

Are there any other native hashing methods such as SHA1/256 besides MD5 on kdb+?

快速搜索仅对 MD5 产生此结果:http://code.kx.com/q/ref/strings/#md5

有没有其他不用自己写的实现方法SHA1/SHA256?

kdb 中没有内置任何东西。您需要使用外部库并编写一个扩展(用于 C 中的 ex)才能使用它。

link 下方有在 KDB 中使用 OpenSSL 库(具有 SHA* 函数)的实现。

https://github.com/johnanthonyludlow/kdb/tree/master/QCrypt

其中的 Pdf link 解释了如何使用它。

.Q 命名空间中现在有一个函数:.Q.sha1 x returns x 的 SHA-1 散列的字节流,其中 x 是一个字符串。

您可以使用 .Q unreference card 来 查看这个和其他实用函数的文档,它们在 .Q 命名空间中而不在默认命名空间中。