xor

package module
v0.0.0-...-f85b25d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2019 License: MIT Imports: 3 Imported by: 0

README

XOR

XOR code engine in pure Go

more than 50GB/S per core

Move to: https://github.com/templexxx/xorsimd

Introduction:

  1. Use SIMD (SSE2 or AVX2) for speeding up
  2. ...

Installation

To get the package use the standard:

go get github.com/templexxx/xor

Documentation

See the associated GoDoc

Performance

Performance depends mainly on:

  1. SIMD extension
  2. unit size of worker
  3. hardware ( CPU RAM etc)

Example of performance on my MacBook 2014-mid(i5-4278U 2.6GHz 2 physical cores). The 16MB per shards.

speed = ( shards * size ) / cost
data_shards shard_size speed (MB/S)
2 1KB 64127.95
2 1400B 59657.55
2 16KB 35370.84
2 16MB 12128.95
5 1KB 78837.33
5 1400B 58054.89
5 16KB 50161.19
5 16MB 12750.41

Who is using this?

  1. https://github.com/xtaci/kcp-go -- A Production-Grade Reliable-UDP Library for golang

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes

func Bytes(dst, src0, src1 []byte)

Bytes : chose the shortest one as xor size it's better to use it for big data ( > 64bytes )

func BytesSameLen

func BytesSameLen(dst, src0, src1 []byte)

BytesSameLen : all slice's length must be equal cut size branch, save time for small data

func BytesSrc0

func BytesSrc0(dst, src0, src1 []byte)

BytesSrc0 : src1 >= src0, dst >= src0 xor src0's len bytes

func BytesSrc1

func BytesSrc1(dst, src0, src1 []byte)

BytesSrc1 : src0 >= src1, dst >= src1 xor src1's len bytes

func Matrix

func Matrix(dst []byte, src [][]byte)

Matrix : all slice's length must be equal && != 0 len(src) must >= 2

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL