@@ -42,8 +42,8 @@ def pysiphash(uint64):
4242
4343def skip_unless_internalhash (test ):
4444 """Skip decorator for tests that depend on SipHash24 or FNV"""
45- ok = sys .hash_info .algorithm in {"fnv" , "siphash24" }
46- msg = "Requires SipHash24 or FNV"
45+ ok = sys .hash_info .algorithm in {"fnv" , "siphash13" , " siphash24" }
46+ msg = "Requires SipHash13, SipHash24 or FNV"
4747 return test if ok else unittest .skip (msg )(test )
4848
4949
@@ -210,6 +210,19 @@ class StringlikeHashRandomizationTests(HashRandomizationTests):
210210 # seed 42, 'abc'
211211 [- 678966196 , 573763426263223372 , - 820489388 , - 4282905804826039665 ],
212212 ],
213+ 'siphash13' : [
214+ # NOTE: PyUCS2 layout depends on endianness
215+ # seed 0, 'abc'
216+ [69611762 , - 4594863902769663758 , 69611762 , - 4594863902769663758 ],
217+ # seed 42, 'abc'
218+ [- 975800855 , 3869580338025362921 , - 975800855 , 3869580338025362921 ],
219+ # seed 42, 'abcdefghijk'
220+ [- 595844228 , 7764564197781545852 , - 595844228 , 7764564197781545852 ],
221+ # seed 0, 'äú∑ℇ'
222+ [- 1093288643 , - 2810468059467891395 , - 1041341092 , 4925090034378237276 ],
223+ # seed 42, 'äú∑ℇ'
224+ [- 585999602 , - 2845126246016066802 , - 817336969 , - 2219421378907968137 ],
225+ ],
213226 'siphash24' : [
214227 # NOTE: PyUCS2 layout depends on endianness
215228 # seed 0, 'abc'
0 commit comments