$ borsh

v1.6.1

Binary Object Representation Serializer for Hashing

Downloads: 105.6M
Recent: 22.4M
Versions: 58
Updated: March 18, 2026

Latest Update Summary

Crate

Name: borsh New version: 1.6.0 Release date: 2025-11-25T16:36:01.763012Z

Crate readme

Short description Rust implementation of the Borsh binary serialization format.

Long description Borsh stands for Binary Object Representation Serializer for Hashing. It is meant to be used in security-critical projects as it prioritizes consistency, safety, speed, and comes with a strict specification.

Features • security-critical projects • consistency • safety • speed • strict specification

Code Examples Basic usage

 use borsh::{BorshSerialize, BorshDeserialize, from_slice, to_vec};

#[derive(BorshSerialize, BorshDeserialize, PartialEq, Debug)]
struct A {
    x: u64,
    y: String,
}

#[test]
fn test_simple_struct() {
    let a = A {
        x: 3301,
        y: "liber primus".to_string(),
    };
    let encoded_a = to_vec(&a).unwrap();
    let decoded_a = from_slice::<A>(&encoded_a).unwrap();
    assert_eq!(a, decoded_a);
}

Linkshttps://crates.io/crates/borshhttps://github.com/near/borsh#specificationhttps://github.com/near/borsh-rs/blob/master/Cargo.toml

https://api.github.com/repos/near/borsh-rs/releases/265195707

Release info

Release version:

Release description

Code Examples

Patch update: 1.6.0 → 1.6.1

$ DOWNLOADS TREND

70.2M105.6M

$ VERSION HISTORY

v1.6.1March 18, 2026
v1.6.0November 25, 2025
v1.5.7March 25, 2025

$ LINKS

$ INSTALL

cargo add borsh

Or add to Cargo.toml: borsh = "1.6.1"