<commit_before>DD-WRT Configuration Conversion Tool
====================================

Description
-----------

This tool converts from a [DD-WRT](http://www.dd-wrt.com) settings backup binary file to a JSON dictionary and vice versa. The format of the binary file from DD-WRT has been described [here](http://www.dd-wrt.com/phpBB2/viewtopic.php?t=33164).

You should be very cautious about restoring a backup binary file, you could brick your device! Of course, I am certainly not responsible for whatever damage you may cause by using this tool. Use at your own risk or do not use it!

Usage
-----
To convert a backup binary file to a JSON file:
```
#> python ddwrt-cfg-conv-tool.py bin2json nvrambak.bin > settings.json
```

To convert a JSON file to a backup binary file:
```
#> cat settings.json | python ddwrt-cfg-conv-tool.py json2bin nvrambak--custom.bin<commit_msg>Minor changes to the README.<commit_after>DD-WRT Firmware Configuration Conversion Tool
=============================================

Description
-----------

This tool converts from a [DD-WRT firmware](http://www.dd-wrt.com) settings backup binary file to a JSON dictionary and vice versa. The format of the binary file from DD-WRT has been described [here](http://www.dd-wrt.com/phpBB2/viewtopic.php?t=33164).

You should be very cautious about restoring a backup binary file, you could brick your device! Of course, I am certainly not responsible for whatever damage you may cause by using this tool. Use at your own risk or do not use it!

Usage
-----
To convert a backup binary file to a JSON file:
```
#> python ddwrt-cfg-conv-tool.py bin2json nvrambak.bin > settings.json
```

To convert a JSON file to a backup binary file:
```
#> cat settings.json | python ddwrt-cfg-conv-tool.py json2bin nvrambak--custom.bin
{'fraction_non_alphanumeric': 0.1403118040089087, 'fraction_numerical': 0.008908685968819599, 'mean_word_length': 4.105113636363637, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3238485', 'n_tokens_mistral': 531, 'n_tokens_neox': 503, 'n_words': 223}