Libraries
bignum
binary
bitmap
ble
bytes
core
crypto
adler32
aes
blake2
chacha20
checksum
cmac
crc
ec
hamming
hkdf
hmac
md5
rsa
sha
sha1
sha256
siphash
device
encoding
esp32
expect
fixed-point
flash
font
gpio
i2c
i2s
icons
io
line-wrap
log
math
monitor
net
pulse-counter
reader
reader-writer
rmt
serial
spi
statistics
system
tls
uart
uuid
writer
zlib
Library hamming
To use this library in your code:
import crypto.hamming
Hamming code.
See
https://en.wikipedia.org/wiki/Hamming_code
Functions
encode-16-11
in/
any
->
any
Encodes an 11-bit integer as a 16-bit integer with error correction bits.
Use
fix-16-11
to check for errors and get the number back.
fix-16-11
in/
any
->
any
Checks the given
in
for possible errors.
Detects up to 2-bits error and corrects all 1-bit errors.
The
in
is a 16-bit number with possible errors.
Returns the corrected 11-bit number if there was no error or error correction was possible.
Returns null otherwise.