Skip to content

opendevtools/base45

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Base45

Test and publish Base45 Crate API

A encoder/decoder for base45 that is fully compatible with draft-faltstrom-base45-02. When encoding QR or Aztec codes a different scheme than the standard base64, base32, and base16 is needed.

Installation

[dependencies]
base45 = "1.0.1"

Benchmarks

Benchmarks were created using Criterion. The benchmarks test encoding and decoding of the string "The quick brown fox jumps over the lazy dog". Test computer is a MacBook Pro 14" (2021) M1 Pro with 32 GB RAM.

encode long string              time:   [107.51 ns 107.69 ns 107.91 ns]
encode long string from buffer  time:   [126.66 ns 126.84 ns 127.07 ns]
decode long string              time:   [115.58 ns 115.81 ns 116.08 ns]

encode long str 100 times       time:   [12.805 µs 12.821 µs 12.839 µs]
decode long str 100 times       time:   [12.407 µs 12.424 µs 12.445 µs]

encode 0x10 random bytes        time:   [57.717 ns 57.827 ns 57.946 ns]
encode 0x100 random bytes       time:   [292.00 ns 292.64 ns 293.50 ns]
encode 0x1000 random bytes      time:   [3.6926 µs 3.6962 µs 3.7001 µs]
encode 0x10000 random bytes     time:   [65.210 µs 65.476 µs 65.755 µs]