Game of Decryption
Takes an image, reads and deciphers text.
Demo: https://ist440-game-of-decryption.netlify.com/
Login:
Username: student
Password: ist440
Developers
git pull https://github.com/lazorfuzz/game-of-decryption
cd game-of-decryption
yarn
or npm install
yarn start
or npm start
Documentation
Component
App ⇐ Kind: global class
Extends: Component
new App()
The base component where we initialize our app tree.
Functions - api.js
- login(username, password) ⇒
Handles login POST
- signup(username, email, password, org_id) ⇒
Handles sign up POST
- getUser([id]) ⇒
Gets user information by ID
- setUser(id, [method], [form]) ⇒
CRUD method for user by ID
- checkCipherSolutionExists(cipher) ⇒
Handles cipher solution check POST
- getSavedSolutions() ⇒
Handles saved solutions fetch
- addSavedSolution(cipher, lang, solution) ⇒
Create a new saved solution POST
- setSavedSolution(id, [method], [form]) ⇒
CRUD method for saved solution by ID
- getOrganization([name]) ⇒
Fetch an organization or list of organizations
- setOrganization(name, [method], [form]) ⇒
CRUD method for organization by name
- solveCipher(cipher, [lang]) ⇒
Handles cipher solve request POST
- getNews([query]) ⇒
Fetch the news by a specific query
login(username, password) ⇒
Handles login POST
Kind: global function
Returns: Response
Param | Type |
---|---|
username | string |
password | string |
signup(username, email, password, org_id) ⇒
Handles sign up POST
Kind: global function
Returns: Response
Param | Type |
---|---|
username | string |
string |
|
password | string |
org_id | number |
getUser([id]) ⇒
Gets user information by ID
Kind: global function
Returns: Response
Param | Type | Default |
---|---|---|
[id] | number |
1 |
setUser(id, [method], [form]) ⇒
CRUD method for user by ID
Kind: global function
Returns: Response
Param | Type | Default |
---|---|---|
id | * |
|
[method] | string |
"'POST'" |
[form] | object |
{} |
checkCipherSolutionExists(cipher) ⇒
Handles cipher solution check POST
Kind: global function
Returns: Response
Param | Type | Description |
---|---|---|
cipher | string |
The text read by the OCR engine |
getSavedSolutions() ⇒
Handles saved solutions fetch
Kind: global function
Returns: Response
addSavedSolution(cipher, lang, solution) ⇒
Create a new saved solution POST
Kind: global function
Returns: Response
Param | Type | Description |
---|---|---|
cipher | string |
The text returned by the OCR engine |
lang | string |
The two-letter language code |
solution | string |
The deciphered text |
setSavedSolution(id, [method], [form]) ⇒
CRUD method for saved solution by ID
Kind: global function
Returns: Response
Param | Type | Default |
---|---|---|
id | number |
|
[method] | string |
"'PUT'" |
[form] | object |
{} |
getOrganization([name]) ⇒
Fetch an organization or list of organizations
Kind: global function
Returns: Response
Param | Type | Default | Description |
---|---|---|---|
[name] | string |
"'all'" |
Organization name. Defaults to all |
setOrganization(name, [method], [form]) ⇒
CRUD method for organization by name
Kind: global function
Returns: Response
Param | Type | Default | Description |
---|---|---|---|
name | * |
The organization's name | |
[method] | string |
"'POST'" |
|
[form] | * |
{} |
solveCipher(cipher, [lang]) ⇒
Handles cipher solve request POST
Kind: global function
Returns: Response
Param | Type | Default | Description |
---|---|---|---|
cipher | string |
The text read by the OCR engine | |
[lang] | string |
"'idk'" |
The language dictionary to look up with. Defaults to 'idk' |
getNews([query]) ⇒
Fetch the news by a specific query
Kind: global function
Returns: Response
Param | Type | Default | Description |
---|---|---|---|
[query] | string |
"'_org'" |
The search query. Defaults to the user's organization name |
Functions - components/Home/read-image.js
- detectLanguage(image, progressCallback) ⇒
Detect the language used in the image
- readImage(image, progressCallback) ⇒
Reads the image with tesseract.js
detectLanguage(image, progressCallback) ⇒
Detect the language used in the image
Kind: global function
Returns: Currently returns a reading of "NULL" for everything. Don't use
Param | Type | Description |
---|---|---|
image | File |
|
progressCallback | * |
The handler for when tesseract.js emits a progress event |
readImage(image, progressCallback) ⇒
Reads the image with tesseract.js
Kind: global function
Returns: Promise -> result object
Param | Type | Description |
---|---|---|
image | File |
|
progressCallback | func |
The handler for when tesseract.js emits a progress event |