跳转到内容

返回字符串在指定位长(224、256、384 或 512)下的 SHA-2 哈希。

func.sha2(<str>, <bit_length>)
func.sha2('hello', 256)
┌───────────────┐
│ '2cf24dba...' │
└───────────────┘
SHA2(<str>, <bit_length>)
SELECT SHA2('hello', 256);
┌──────────────────────────────────────────────────────────────────┐
│ 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 │
└──────────────────────────────────────────────────────────────────┘