Skip to content

Operation request: Set theory ops #236

@n1474335

Description

@n1474335

Summary

It would be useful to have a number of operations to perform common set theory tasks on data. Operations could include:

  • Union
  • Intersection
  • Set Difference
  • Symmetric Difference
  • Cartesian Product
  • Power Set

Details here: https://en.wikipedia.org/wiki/Set_theory

Multiple sets could be input with a delimiter between them in a similar fashion to the 'Diff' operation.

There are some operations already in CyberChef which fulfil some of these functions (such as the 'Unique' operation), however it would be useful to have a full set dedicated to multiple input sets. These operations could live in the 'Arithmetic/Logic' category.

Example

Operation: Union
Args:

  • Sample delimiter: \n\n
  • Item delimiter: ,

Input:

One,Two,Three

Two,Three,Four

Output:

One,Two,Three,Four

Operation: Intersection
Args:

  • Sample delimiter: \n\n
  • Item delimiter: ,

Input:

One,Two,Three

Two,Three,Four

Output:

Two,Three

Operation: Set Difference
Args:

  • Sample delimiter: \n\n
  • Item delimiter: ,

Input:

One,Two,Three

Two,Three,Four

Output:

One

Operation: Symmetric Difference
Args:

  • Sample delimiter: \n\n
  • Item delimiter: ,

Input:

One,Two,Three

Two,Three,Four

Output:

One,Four

Operation: Cartesian Product
Args:

  • Sample delimiter: \n\n
  • Item delimiter: ,

Input:

One,Two,Three

A,B,C

Output:

(One,A),(Two,B),(Three,C)

Operation: Power Set
Args:

  • Item delimiter: ,

Input:

One,Two,Three

Output:


One
Two
Three
One,Two
One,Three
Two,Three
One,Two,Three

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions