Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
slips
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DeStream-public
slips
Commits
c49fa840
Unverified
Commit
c49fa840
authored
Jul 26, 2018
by
Pavol Rusnak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slip-0039: add wordlist test
parent
52bb7c61
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
slip-0039.md
slip-0039.md
+5
-2
test_wordlist.sh
slip-0039/test_wordlist.sh
+16
-0
No files found.
slip-0039.md
View file @
c49fa840
...
...
@@ -89,9 +89,12 @@ No localization is supported. This standard deals with a set of English words on
Wordlist mandated by this SLIP is
[
available here
](
slip-0039/wordlist.txt
)
. Several criteria were applied where creating the list:
*
wordlist is alphabetically sorted
*
wordlist contains only common English word
s
*
no word is
shorter than 4 letters and
longer than 8 letters
*
no word is shorter than 4 letter
s
*
no word is longer than 8 letters
*
all words have unique 4-letter prefix
*
wordlist contains only common English words (+ the word "satoshi")
(see the
[
test
](
slip-0039/test_wordlist.sh
)
which checks whether these criteria are fulfilled).
## Test Vectors
...
...
slip-0039/test_wordlist.sh
0 → 100755
View file @
c49fa840
#!/bin/bash
# wordlist is alphabetically sorted
diff wordlist.txt <
(
sort
wordlist.txt
)
&&
echo
OK
# no word is shorter than 4 letters
diff wordlist.txt <
(
grep
'^....'
wordlist.txt
)
&&
echo
OK
# no word is longer than 8 letters
!
grep
-q
'^.........'
wordlist.txt
&&
echo
OK
# all words have unique 4-letter prefix
diff <
(
cut
-c
1-4 wordlist.txt
)
<
(
cut
-c
1-4 wordlist.txt |
sort
-u
)
&&
echo
OK
# wordlist contains only common English words (+ the word "satoshi")
test
"
$(
comm
-23
wordlist.txt <
(
aspell
-l
en dump master |
tr
[
A-Z]
[
a-z] |
sort
)
)"
=
"satoshi"
&&
echo
OK
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment