Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Optimus.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function encode(int $value): int
return (gmp_intval(gmp_mul($value, $this->prime)) & $this->max) ^ $this->xor;
}

return (($value * $this->prime) & $this->max) ^ $this->xor;
return ((int) ($value * $this->prime) & $this->max) ^ $this->xor;
}

public function decode(int $value): int
Expand All @@ -74,7 +74,7 @@ public function decode(int $value): int
return gmp_intval(gmp_mul($value ^ $this->xor, $this->inverse)) & $this->max;
}

return (($value ^ $this->xor) * $this->inverse) & $this->max;
return (int) (($value ^ $this->xor) * $this->inverse) & $this->max;
}

public function setMode(string $mode)
Expand Down