aboutsummaryrefslogtreecommitdiffhomepage
path: root/README.source
blob: d7c7bbef65cecd081471fc66838cb01cc294db9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Shared library conversion
-------------------------

As explained in the unpatched README.md, upstream intends zxcvbn-c to
be embedded in the source trees of projects that require it.  For the
purposes of this Debian package, though, it is compiled as a shared
library and as a static library.

The word lists, *.txt in the source package, may be either
  (a) compiled to a file zxcvbn.dict, or
  (b) included in the object compiled from zxcvbn.c (in our case, in
      libzxcvbn.so.* & libzxcvbn.a).
This choice is made by means of the USE_DICT_FILE compiler macro.

Contrary to what you might expect, method (a) does not permit swapping
out zxcvbn.dict for a different file: CRCs for zxcvbn.dict are
compiled into the object compiled from zxcvbn.c (in our case, in
libzxcvbn.so.0 & libzxcvbn.a).

So method (a) is useless when zxcvbn-c is compiled as a shared or
static library.  Further, it complicates usage: a library user must
call ZxcvbnInit() with the path to the immutable zxcvbn.dict, and
later ZxcvbnUninit().

Given the above facts about option (a), I have opted to use option (b)
for this Debian package.  USE_DICT_FILE is unset.  Calls to
ZxcvbnInit() and ZxcvbnUninit() are not required, and README.md has
been patched accordingly.

 -- Sean Whitton <spwhitton@spwhitton.name>, Sat, 24 Sep 2016 15:24:12 -0700