All Projects → superwhiskers → crunch

superwhiskers / crunch

Licence: MPL-2.0 license
take bytes out of things easily ✨🍪

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to crunch

Data-Structures-Algorithms-Handbook
A series of important questions with solutions to crack the coding interview and ace it!
Stars: ✭ 30 (-49.15%)
Mutual labels:  bit-manipulation
lattice-symmetries
A package to simplify working with symmetry-adapted quantum many-body bases. Provides a good foundation for writing custom exact diagonalization and variational Monte Carlo software
Stars: ✭ 17 (-71.19%)
Mutual labels:  bit-manipulation
algorithms
The All ▲lgorithms documentation website.
Stars: ✭ 114 (+93.22%)
Mutual labels:  bit-manipulation
Competitive Programming
Programming👨‍💻 Questions on BinarySearch💻, LeetCode💻, CodeChef💻, Codeforces💻,DSA 450
Stars: ✭ 188 (+218.64%)
Mutual labels:  bit-manipulation
Java-Programs
Java Practiced Problems including concepts of OOPS, Interface, String , Collection.
Stars: ✭ 51 (-13.56%)
Mutual labels:  bit-manipulation
Algorithms-Java
A collection of common algorithms and data structures implemented in Java.
Stars: ✭ 141 (+138.98%)
Mutual labels:  bit-manipulation
deepmage
Hex editor for bit-level occultism
Stars: ✭ 21 (-64.41%)
Mutual labels:  bit-manipulation
Data-Structure-Algorithm-Programs
This Repo consists of Data structures and Algorithms
Stars: ✭ 464 (+686.44%)
Mutual labels:  bit-manipulation
Algorithms and data structures
180+ Algorithm & Data Structure Problems using C++
Stars: ✭ 4,667 (+7810.17%)
Mutual labels:  bit-manipulation
Algodeck
An Open-Source Collection of 200+ Algorithmic Flash Cards to Help you Preparing your Algorithm & Data Structure Interview 💯
Stars: ✭ 4,441 (+7427.12%)
Mutual labels:  bit-manipulation
Awesome Bits
💻 A curated list of awesome bitwise operations and tricks
Stars: ✭ 2,791 (+4630.51%)
Mutual labels:  bit-manipulation
Java-Questions-and-Solutions
This repository aims to solve and create new problems from different spheres of coding. A path to help students to get access to solutions and discuss their doubts.
Stars: ✭ 34 (-42.37%)
Mutual labels:  bit-manipulation
cs-problems
Some 70+ interesting computer science problems and solutions in C#
Stars: ✭ 28 (-52.54%)
Mutual labels:  bit-manipulation
bitter
Is a lightweight API for reading an arbitrary amount of bits from a single input
Stars: ✭ 12 (-79.66%)
Mutual labels:  bit-manipulation
InterviewBit
Collection of solution for problems on InterviewBit
Stars: ✭ 77 (+30.51%)
Mutual labels:  bit-manipulation

cookie with a bite taken out of it
crunch

a library for easily manipulating bits and bytes in golang

license documentation go go report card try it on repl.it

features | installation | benchmarks | examples

features

  • feature-rich: supports reading and writing integers of varying sizes in both little and big endian
  • performant: performs more than twice as fast as the standard library's bytes.Buffer
  • simple and familiar: has a consistent and easy-to-use api
  • licensed under the mpl-2.0: use it anywhere you wish, just don't change it privately

installation

install with the go tool

$ go get github.com/superwhiskers/crunch/v3

then, just import it in your project like this. easy!

package "yourpackage"

import crunch "github.com/superwhiskers/crunch/v3"

install using git submodules (not recommended)

# this assumes that you are in a git repository
$ git submodule add https://github.com/superwhiskers/crunch path/to/where/you/want/crunch

then, you can import it like this

package "yourpackage"

import crunch "github.com/your-username/project/path/to/crunch/v3"

benchmarks

both Buffer and MiniBuffer perform on average more than twice as fast as bytes.Buffer in both writing and reading

goos: linux
goarch: amd64
pkg: github.com/superwhiskers/crunch/v3
cpu: Intel(R) Core(TM) i5-4300M CPU @ 2.60GHz
BenchmarkBufferWriteBytes-4       	612593820	         1.948 ns/op	       0 B/op	       0 allocs/op
BenchmarkBufferReadBytes-4        	1000000000	         0.5476 ns/op	       0 B/op	       0 allocs/op
BenchmarkBufferWriteU32LE-4       	125229171	         9.528 ns/op	       0 B/op	       0 allocs/op
BenchmarkBufferReadU32LE-4        	44677784	        24.73 ns/op	       8 B/op	       1 allocs/op
BenchmarkBufferReadBit-4          	1000000000	         0.5709 ns/op	       0 B/op	       0 allocs/op
BenchmarkBufferReadBits-4         	620840577	         1.869 ns/op	       0 B/op	       0 allocs/op
BenchmarkBufferSetBit-4           	600202990	         1.929 ns/op	       0 B/op	       0 allocs/op
BenchmarkBufferClearBit-4         	625814206	         1.993 ns/op	       0 B/op	       0 allocs/op
BenchmarkBufferGrow-4             	252735192	         6.638 ns/op	       0 B/op	       0 allocs/op
BenchmarkMiniBufferWriteBytes-4   	577940112	         2.112 ns/op	       0 B/op	       0 allocs/op
BenchmarkMiniBufferReadBytes-4    	1000000000	         0.5531 ns/op	       0 B/op	       0 allocs/op
BenchmarkMiniBufferWriteU32LE-4   	116178949	        12.90 ns/op	       0 B/op	       0 allocs/op
BenchmarkMiniBufferReadU32LE-4    	189681555	         6.296 ns/op	       0 B/op	       0 allocs/op
BenchmarkMiniBufferWriteF32LE-4   	121033429	        13.06 ns/op	       0 B/op	       0 allocs/op
BenchmarkMiniBufferReadF32LE-4    	170977377	         7.244 ns/op	       0 B/op	       0 allocs/op
BenchmarkMiniBufferReadBit-4      	1000000000	         0.4730 ns/op	       0 B/op	       0 allocs/op
BenchmarkMiniBufferReadBits-4     	249350655	         4.968 ns/op	       0 B/op	       0 allocs/op
BenchmarkMiniBufferSetBit-4       	566985802	         2.173 ns/op	       0 B/op	       0 allocs/op
BenchmarkMiniBufferClearBit-4     	531134203	         2.195 ns/op	       0 B/op	       0 allocs/op
BenchmarkMiniBufferGrow-4         	271458589	         4.434 ns/op	       0 B/op	       0 allocs/op
BenchmarkStdByteBufferWrite-4     	127322588	         9.249 ns/op	       0 B/op	       0 allocs/op
BenchmarkStdByteBufferRead-4      	319744824	         3.742 ns/op	       0 B/op	       0 allocs/op
BenchmarkStdByteBufferGrow-4      	274847331	         4.367 ns/op	       0 B/op	       0 allocs/op

examples

examples can be found in the examples directory

acknowledgements

icon (cookie logo) made by freepik from flaticon.com

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].