Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "tests": [
- {
- "input": [],
- "seed": 0,
- "expected": 0,
- "comment": "with zero data and zero seed, everything becomes zero"
- },
- {
- "input": [],
- "seed": 1,
- "expected": 1364076727,
- "comment": "ignores nearly all the math"
- },
- {
- "input": [],
- "seed": 4294967295,
- "expected": 2180083513,
- "comment": "make sure your seed uses unsigned 32-bit math"
- },
- {
- "input": [
- 255,
- 255,
- 255,
- 255
- ],
- "seed": 0,
- "expected": 1982413648,
- "comment": "make sure 4-byte chunks use unsigned math"
- },
- {
- "input": [
- 33,
- 67,
- 101,
- 135
- ],
- "seed": 0,
- "expected": 4116402539,
- "comment": "Endian order. UInt32 should end up as 0x87654321"
- },
- {
- "input": [
- 33,
- 67,
- 101,
- 135
- ],
- "seed": 1350757870,
- "expected": 593689054,
- "comment": "Special seed value eliminates initial key with xor"
- },
- {
- "input": [
- 33,
- 67,
- 101
- ],
- "seed": 0,
- "expected": 2118813236,
- "comment": "Only three bytes. Should end up as 0x654321"
- },
- {
- "input": [
- 33,
- 67
- ],
- "seed": 0,
- "expected": 2700587130,
- "comment": "Only two bytes. Should end up as 0x4321"
- },
- {
- "input": [
- 33
- ],
- "seed": 0,
- "expected": 1919294708,
- "comment": "Only one byte. Should end up as 0x21"
- },
- {
- "input": [
- 0,
- 0,
- 0,
- 0
- ],
- "seed": 0,
- "expected": 593689054,
- "comment": "Make sure compiler doesn't see zero and convert to null"
- },
- {
- "input": [
- 0,
- 0,
- 0
- ],
- "seed": 0,
- "expected": 2247144487,
- "comment": null
- },
- {
- "input": [
- 0,
- 0
- ],
- "seed": 0,
- "expected": 821347078,
- "comment": null
- },
- {
- "input": [
- 0
- ],
- "seed": 0,
- "expected": 1364076727,
- "comment": null
- }
- ]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement