On this page:
rs-encode
rs-decode

2 Usage🔗ℹ

 (require reed-solomon) package: reed-solomon

procedure

(rs-encode data_list 
  parity_length 
  [#:bit_width bit_width 
  #:primitive_poly_value primitive_poly_value]) 
  (listof exact-integer?)
  data_list : (listof exact-integer?)
  parity_length : natural?
  bit_width : natural? = 8
  primitive_poly_value : natural? = 285
data_list is a list of integer, each integer’s range is 0 - 2^bit_width-1

parity_length is user defined, (floor (/ parity_length 2)) is recovery capacity.

ie: parity_length is 4, it can recover 2 symbols at most.

bit_width: from 2 - 32

primitive_poly_value: each bit width has multiple available primitive values.

encode and decode should use the same primitive poly value.

2-32 bits available primitive value table

procedure

(rs-decode data_list 
  parity_length 
  [#:bit_width bit_width 
  #:primitive_poly_value primitive_poly_value]) 
  (listof exact-integer?)
  data_list : (listof exact-integer?)
  parity_length : natural?
  bit_width : natural? = 8
  primitive_poly_value : natural? = 285
data_list is a list of data, appended rs code.

parity_length, bit_width, primitive_poly_value should be consistent as encode.