- How does this calculator work?
- Why does the input need a specified type?
- What are the allowed types?
- Can the calculator handle large input?
- What is the privacy policy?

The calculator uses the GNU Multiple Precision (GMP) extension in PHP to calculate XOR. The function gmp_xor takes two GMP resources as inputs and outputs a GMP resource. The calculator's inputs can be different types (base 2, 10, 16) and are initialized using the gmp_init function. Since gmp_init does not support base 256, the calculator converts ASCII inputs into and out of hexadecimal prior to initialization.

To reduce the extra step of converting inputs into a specific type, the calculator allows users to input as binary, decimal, hexadecimal or ASCII. The consequence of this is that the calculator needs to know the types of the inputs in order to accurately calculate the output.

There are ASCII characters that cannot be displayed correctly in html. Therefore, ASCII is not a realiable type for abitrary output values.

- Binary: {0, 1}
- Decimal: {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
- Hexadecimal: {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f}
- ASCII: {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, {, |, }, ~, !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @} 256 character in total, which includes control and extended characters that are not displayed.

Yes, although an early version of this calculator used the built-in XOR bitwise operator in PHP. This meant that inputs and outputs were limited to signed 64-bit integers (2^64/2 or 9,223,372,036,854,775,808). The current implementation uses the GMP extension that is able to handle much larger inputs. The limiting factor will be the size of the POST data to the calculator.

This site does not use cookies and does not have third-party content. The site automatically logs all requests and uses tools to track usage and find errors. This data is stored on the server without encryption. In addition, since this site does not use SSL/TLS (i.e. https), the calculator inputs and outputs travel across networks in plaintext and are not secure. Dec. 10, 2014 UPDATE: now with optional https support.

XOR "exclusive or" is a bitwise (and logical) operation that outputs 1 (true) if the two inputs are not the same and outputs 0 (false) if the two inputs are the same. With the XOR calculator, this operation occurs at each bit. For example:

Input I | Input II | Output |
---|---|---|

0 | 0 | 0 |

0 | 1 | 1 |

1 | 0 | 1 |

1 | 1 | 0 |

To demonstrate how XOR works with the calculator, try setting inputs and output to binary.

Other bitwise operations include: AND, OR, NOT

Input I | Input II | Output |
---|---|---|

0 | 0 | 0 |

0 | 1 | 0 |

1 | 0 | 0 |

1 | 1 | 1 |

Input I | Input II | Output |
---|---|---|

0 | 0 | 0 |

0 | 1 | 1 |

1 | 0 | 1 |

1 | 1 | 1 |

Input | Output |
---|---|

0 | 1 |

1 | 0 |