Giter Site home page Giter Site logo

xor's Introduction

XOR Files with AVX2

This program performs a bitwise XOR operation on the contents of two files using AVX2 instructions for efficient processing. It's written in Go, utilizing cgo to integrate AVX2-based operations written in C for enhanced performance.

Prerequisites

  • Go (1.21 or later recommended)
  • GCC compiler (for cgo to compile C code)

Installation

  1. Clone the repository to your local machine:
git clone https://github.com/qnfm/xor.git
  1. Navigate to the cloned repository:
cd xor
  1. Compile the program:
go build -o xor

Usage

xor <input file 1> <input file 2> <output file>

Replace <input file 1>, <input file 2>, and with the paths to your input files and the desired output file path, respectively. Note that the input files must be of the same size.

Benchmark

go test -benchmem -bench=.

How It Works

The program reads the contents of two files into memory, performs a bitwise XOR operation between each corresponding byte in the files using AVX2 instructions, and writes the result to an output file. This is achieved by embedding C code in the Go program using cgo, allowing for the use of AVX2 instructions for the XOR operation.

Contributing

Contributions are welcome! If you have suggestions for improvements or encounter any issues, please open an issue or submit a pull request.

xor's People

Contributors

qnfm avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.