Giter VIP home page Giter VIP logo

simple-dict's Introduction

simple-dict

database["key"]="value" with tea encryption.

Prepare

Install simple-crypto and simple-protobuf into /usr/local according to their README.

Compile

Clone this project into a system with cmake & libpthread installed. If you plan to compile it on Windows, you ought to edit the source code and transform socket/thread/file libraries into a Windows version.

git clone https://github.com/fumiama/simple-dict-server.git

Create a build folder.

cd simple-dict-server
mkdir build

Use cmake command to generate files for make automatically.

cd build
cmake ..

Use make to generate executable binary files named simple-dict-server and simple-dict-client in ./build directory.

make

Optional: Use make install to install simple-dict-server into /usr/local/bin.

Execute

Start server on localhost using the commands below.

chmod +x simple-dict-server simple-dict-client
Usage:
./simple-dict-server [-d] listen_port dict_file [ config_file | - ]
        -d: As daemon
        - : Read config from env SDS_PWD & SDS_SPS

cfg.spis generated by cfgwriter, otherwise you can pass config by setting env SDS_PWD and SDS_SPS.

Open another shell to connect to it.

./simple-dict-client 127.0.0.1 7777

Now you have connected to the server. The default access passwords is in client.c and you can modify the password in source code as you like. Please note that the server will only wait 4 seconds for a response after the last communication. You can go to server.h to edit this limit. The box below shows how to control the server to accompilsh basic add/del/find/edit operations.

cmd data description reply
get: key get key value the value or "null"
cat: filename save raw dict.sp into filename the raw data
md5: md5 str compare whether md5 of dict.sp is what given in data "nequ" or "null"
end no data end conversation no reply
set: key set key "data"
dat: value to set give value to the key "succ"
del: key del key "succ" or "null
  • The raw data starts with an integer showing its size, then a char $ follows, finally following all binary data in ./dict.sp encoded by TEA.
  • Whenever the reply is "erro", it indicates that the server has some troubles, which means that you shuold end the conversation and retry later.

A cmd sequence example is as below

demo.mp4

Android Client for simple-dict-server

There is also an Android Client for simple-dict-server. Just install the apk file downloaded from release page and click config icon to set your server address using the format

127.0.0.1:7777_password^superpassword

Note that this APP is designed for a new language called Tenenja, so the font inside is abnormal. What's more, there is no English translation for this APP because its users are Chinese. If you want to get an APP in your language, just edit the source code for free.

simple-dict's People

Contributors

fumiama avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.