Appearance
HASH4
Apply the xxHash64
(32-bit) hashing algorithm to a character string.
HASH4(string [, algorithm ])
- string
- Specify a character string that is the input to the function.
- algorithm
- Optionally, specify
0
for the algorithm (xxHash64
, 32-bit). No other algorithm values are valid.
The return type of this function is INTEGER
(INT4
).
Examples
For example:
premdb=# select nickname, hash4(nickname,0) hashname
from team
where htid <10
order by nickname;
nickname | hashname
-----------+-------------
Blues | -387055223
Cherries | 1443820713
Gunners | 1253095579
Rovers | 1003253655
Seasiders | -2087951145
Trotters | 1669174631
Tykes | 866713967
Villains | -1467766758
(8 rows)
premdb=# select hash4('We are such stuff as dreams are made on')
from sys.const;
hash4
-----------
917459684
(1 row)