From 542e5393b0b357e67ddea09c51fc8d1755b8eea6 Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Thu, 22 Jun 2023 01:14:34 +0200 Subject: [PATCH] add description to rabin modules --- hash/rabin-gf2-polynomial.js | 11 +++++++++++ hash/rabin-uncached.js | 7 +++++++ hash/rabin.js | 7 +++++++ 3 files changed, 25 insertions(+) diff --git a/hash/rabin-gf2-polynomial.js b/hash/rabin-gf2-polynomial.js index 5bc90e5..8579edf 100644 --- a/hash/rabin-gf2-polynomial.js +++ b/hash/rabin-gf2-polynomial.js @@ -1,3 +1,14 @@ +/** + * The idea of the Rabin fingerprint algorithm is to represent the binary as a polynomial in a + * finite field (Galois Field G(2)). The polynomial will then be taken "modulo" by an irreducible + * polynomial of the desired size. + * + * This implementation is inefficient and is solely used to verify the actually performant + * implementation in `./rabin.js`. + * + * @module rabin-gf2-polynomial + */ + import * as math from '../math.js' import * as webcrypto from 'lib0/webcrypto' import * as array from '../array.js' diff --git a/hash/rabin-uncached.js b/hash/rabin-uncached.js index 11ddd50..f40da97 100644 --- a/hash/rabin-uncached.js +++ b/hash/rabin-uncached.js @@ -1,3 +1,10 @@ +/** + * It is not recommended to use this package. This is the uncached implementation of the rabin + * fingerprint algorithm. However, it can be used to verify the `rabin.js` implementation. + * + * @module rabin-uncached + */ + import * as math from '../math.js' import * as buffer from '../buffer.js' diff --git a/hash/rabin.js b/hash/rabin.js index e84c349..9526fd3 100644 --- a/hash/rabin.js +++ b/hash/rabin.js @@ -1,3 +1,10 @@ +/** + * @module rabin + * + * Very efficient & versatile fingerprint/hashing algorithm. However, it is not cryptographically + * secure. + */ + import * as buffer from '../buffer.js' import * as map from '../map.js'