scodec/scodec-bits
58.7
Adequate · 20 September 2026
7.3k
lines of production code
Scala
primary language
1
measurement over time
What this system is
scodec-bits is a cross-platform Scala library providing immutable BitVector and ByteVector data structures for efficient binary data manipulation. It supports JVM, JavaScript, and Native platforms, offering features such as base conversions, CRC calculations, and platform-specific cryptographic and compression operations. The library includes compile-time string interpolators for literals and integrates with native memory types on each target platform.
How it got here
2014–2015 — Initial release and core development
6 changes.
This period marks the initial release of the scodec-bits library, introducing immutable BitVector and ByteVector types for efficient binary data manipulation. The work focused on establishing core features such as base conversions, CRC calculations, and streaming I/O, alongside comprehensive testing and benchmarking to ensure correctness and performance.
2020–2022 — Cross-platform expansion and binary compatibility
7 changes.
The project focused on extending core BitVector and ByteVector functionality to support JVM, JavaScript, and Native platforms, including native typed array integration and platform-specific crypto/compression. Concurrently, binary compatibility with the 1.1.x series was restored, and compile-time string interpolators were added to enhance safety and performance.
Features
Add Native platform support for ByteVector pointer operations
This change introduces the necessary cross-platform trait implementations for the Native target, specifically enabling \ByteVector\ to interact with native memory pointers. Users can now use \ByteVector.view\ and \ByteVector.fromPtr\ to create vectors from \Ptr\[Byte\]\ references, and utilize \copyToPtr\ and \toPtr\ to copy data into or allocate new native memory buffers. This completes the cross-platform compatibility for bit-vector operations on Scala Native.
core/native · high confidence
Add compile-time string interpolators for hex, binary, ASCII, and UTF-8
The library now provides \hex\, \bin\, \asciiBytes\, and \utf8Bytes\ string interpolators that convert literal strings into \ByteVector\ or \BitVector\ instances at compile time. These interpolators validate the input content (e.g., ensuring hexadecimal strings only contain valid hex characters) and fail compilation with clear error messages if the literals are invalid or contain unsupported interpolation arguments, offering a safer and more efficient alternative to runtime parsing.
core/shared/src/main/scala-3 · high confidence
Added \`asciiBytes\` and \`utf8Bytes\` string interpolators
The \scodec.bits\ package now includes \asciiBytes\ and \utf8Bytes\ string interpolators, allowing users to convert ASCII and UTF-8 strings directly into \ByteVector\ instances at compile time. These new interpolators are implemented via macros in \LiteralSyntaxMacros\ and are exposed through the \package.scala\ definitions, complementing the existing \bin\ and \hex\ interpolators for binary and hexadecimal literals.
core/shared/src/main/scala-2 · high confidence
Initial release of scodec-bits core library
This change introduces the core \scodec-bits\ library, providing immutable \BitVector\ and \ByteVector\ types for efficient binary data manipulation. The release includes comprehensive support for base conversions (binary, hexadecimal, base32, base64, base58) via the \Bases\ object, CRC calculation utilities, and configurable hex dump formatting with ANSI color support. It also adds bitwise operations, streaming I/O capabilities, and Scala 2.11-specific compatibility shims to ensure broad version support.
core/shared/src/main/scala · high confidence
Initial release of scodec-bits with BitVector and ByteVector
This entry introduces the scodec-bits library, providing immutable \BitVector\ and \ByteVector\ data structures for working with bits and bytes. The library supports hex and binary string literals, base conversions (binary, hexadecimal, base 64), and efficient lazy access to Java NIO sources. It includes features such as CRC calculation, digest support, and serialization, while maintaining zero external dependencies to ensure broad applicability.
(repo-wide) · high confidence
JVM-only crypto and compression implementations added
The \core/jvm\ module now provides JVM-specific implementations for \BitVector\ and \ByteVector\ that expose ZLIB compression (deflate/inflate) and cryptographic operations (SHA-1, SHA-256, MD5 digests, and encryption/decryption via \javax.crypto.Cipher\). These new platform-specific traits (\BitVectorCrossPlatform\, \ByteVectorCrossPlatform\, and their companion traits) consolidate Java-standard library dependencies for security and compression, making these capabilities available exclusively on the JVM platform.
core/jvm/src/main · high confidence
Native JavaScript typed-array support for ByteVector
The ByteVector API in the JavaScript platform now includes direct conversion methods for JavaScript's native typed arrays. Users can create ByteVectors from Uint8Array and ArrayBuffer objects using the new \view\, \fromUint8Array\, and \fromJSArrayBuffer\ companion methods, and can export ByteVector data back to JavaScript using \toUint8Array\ and \toJSArrayBuffer\. This enables more efficient, zero-copy (where possible) or direct-memory-interaction workflows with JavaScript libraries that expect these specific types.
core/js/src/main · high confidence
Behavioural changes
Restored binary compatibility with 1.1.x series
The library has been updated to restore binary compatibility with the 1.1.x series, allowing users to upgrade without breaking existing code that depends on previous 1.1.x versions. This change also includes the removal of a previous workaround for binary compatibility issues and the resolution of compiler warnings, resulting in a cleaner and more stable codebase.
core/shared/src/main/scala-2.12, core/shared/src/main/scala-2.13 · medium confidence
Test coverage
Added JMH benchmarks for ByteVector and BitVector operations; Added JVM-specific test suites for BitVector, ByteVector, and CRC; Added JavaScript-specific tests for ByteVector typed array integration; Added comprehensive property-based and integration tests for BitVector and ByteVector.
Dependencies
Update build to sbt-typelevel and cross-compile for Scala 2.12, 2.13, and 3
The build system has been migrated to sbt-typelevel, enabling cross-compilation for JVM, JavaScript, and Native platforms across Scala 2.12.21, 2.13.18, and 3.3.8. This update introduces binary compatibility checks via MiMa with specific exclusions for internal API changes (such as \GroupedOp\ and \EitherOps\ removals) and updates the test dependency to munit-scalacheck 1.3.1. The base version is set to 1.2, reflecting the introduction of Scala 3 support in version 1.1.27.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 59.
Lenses
- Code Health 94
- Architecture 100
- Maturity 41
- Readiness 67
- Security 70
Changes since last survey
- 300 commits — 290 feature/other, 10 fixes
By area
- (repo) — 148 commits
- (root) — 53 commits
- project/plugins.sbt — 47 commits
- project/build.properties — 20 commits
- core/shared — 19 commits
- .github/workflows — 9 commits
- core/native — 3 commits
- core/jvm — 1 commit
Notable commits
- fix: Fix build
- fix: Fix compilation on native
- fix: Fix compilation on native
- fix: Fixes #558
- fix: Fixes bug in BitVector#lastOption when called on emtpy vector. Fixes #607
- fix: Fixes bug in reverseBitOrder that broke crc calculations
- fix: Merge pull request #467 from armanbilge/fix/toByteBufferUnsafe-independent-position-limit
- fix: Merge pull request #559 from scodec/bugfix/558
- fix: Merge pull request #563 from scodec/bugfix/557
- fix: Merge pull request #608 from scodec/topic/fix-empty-lastOption
- change: Add 'Reformat with scalafmt 3.9.7' to .git-blame-ignore-revs
- change: Add ByteVector#equalsConstantTime
- change: Add example of hex with comments
- change: Add methods for converting to/from BigInt
- change: Add mima exclusion
- change: Add note to ScalaDoc
- change: Add sliding to both BitVector and ByteVector
- change: Add support for | as comment char
- change: Bump base version to 1.2.0 and adjust mima
- change: Correct interpolator docs for Scala 3
- …and 280 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
scodec/scodec-bits was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 20 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit bc1654b42d782ab2433e0fa0e0307326d1b5735d — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.