scodec-bits


License

License

GroupId

GroupId

org.scodec
ArtifactId

ArtifactId

scodec-bits_2.10
Last Version

Last Version

1.1.12
Release Date

Release Date

Type

Type

bundle
Description

Description

scodec-bits
scodec-bits
Project URL

Project URL

http://github.com/scodec/scodec-bits
Project Organization

Project Organization

org.scodec
Source Code Management

Source Code Management

https://github.com/scodec/scodec-bits

Download scodec-bits_2.10

Dependencies

compile (1)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.10.7

provided (1)

Group / Artifact Type Version
org.scala-lang : scala-reflect jar 2.10.7

Project Modules

There are no modules declared in this project.

scodec-bits

Provides persistent datatypes for working with bits and bytes.

Design Constraints

  • No dependencies on other libraries in order to be applicable to as many projects as possible.

Administrative

This project is licensed under a 3-clause BSD license.

The scodec channel on Gitter is a good place to go for help. Also consider using the scodec tag on StackOverflow.

Introduction

There are two fundamental data structures provided:

Both datatypes provide collection like functionality, although neither directly implement the Scala collection library traits. Both are implemented as binary trees where each node is either a leaf node containing bits/bytes or is an inner node containing an operation on other trees (e.g., append). As a result, many operations are implemented in logarithmic time with respect to the depth of the tree.

Both strict and lazy constructors are provided. Of particular interest are the methods that work with Java NIO sources like java.nio.channels.ReadableByteChannel and java.nio.channels.FileChannel, which allow efficient, lazy access and manipulation of bits and bytes from a variety of sources.

Hexadecimal and binary string literals are supported via the hex and bin string interpolators. For example:

val x: ByteVector = hex"deadbeef"
val y: BitVector = bin"00101101010010101"

Base conversions to and from strings are supported. Binary, hexadecimal, and base 64 conversions are supported. Each have a default alphabet but support alternative alphabets as well as user defined alphabets.

For more information, see the API documentation.

For a combinator based approach to encoding values to/from binary, see the companion project scodec.

Getting Binaries

See the releases page on the website.

Building

This project uses sbt and requires node.js to be installed in order to run Scala.js tests. To build, run sbt publish-local.

Code of Conduct

See the Code of Conduct.

org.scodec
Scala combinator library for working with binary data.

Versions

Version
1.1.12
1.1.11
1.1.10
1.1.9
1.1.8
1.1.5
1.1.4
1.1.3
1.1.2
1.1.1
1.1.0
1.0.12
1.0.11
1.0.10
1.0.9
1.0.7
1.0.6
1.0.5