Skip to content

Commit

Permalink
1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hiimjasmine00 committed Apr 27, 2023
0 parents commit fe078cc
Show file tree
Hide file tree
Showing 25 changed files with 1,969 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
end_of_line = lf
charset = utf-8

[{*.{json,yaml},.git*}]
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = false

[{*.ts}]
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true

[{cjs,esm}/*.js]
indent_size = 2
trim_trailing_whitespace = false
insert_final_newline = false

[types/*.d.ts]
indent_size = 4
trim_trailing_whitespace = false
insert_final_newline = false
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cjs
esm
types
docs
node_modules
5 changes: 5 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://json.schemastore.org/mocharc",
"spec": ["test/**/*.test.ts"],
"require": ["ts-node/register"]
}
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
**/**
!**/*.js
!**/*.ts
.git
.vscode
cjs
esm
types
node_modules
9 changes: 9 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
tabWidth: 4
semi: true
singleQuote: false
quoteProps: consistent
trailingComma: none
bracketSpacing: true
arrowParens: avoid
parser: typescript
endOfLine: lf
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 hiimjustin000

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# crypchar
Encryption and decryption of characters using arithmetic operations.

## Installation
```bash
$ npm install crypchar
```

## Importing
This library can be imported using the following syntax:
```js
const crypchar = require("crypchar");
const { add, subtract, xor, not } = require("crypchar");
const xor = require("crypchar/xor");
```
```js
import * as crypchar from "crypchar";
import { add, subtract, xor, not } from "crypchar";
import xor from "crypchar/xor";
```

## Usage
```js
const crypchar = require("crypchar");
crypchar.add("Hello World!", 5, "utf8"); // "Mjqqt%\twqi&"
crypchar.subtract("Mjqqt%\\twqi&", 5, "utf8"); // "Hello World!"
crypchar.xor("Hello World!", 11, "utf8"); // "Cnggd+\dygo*"
crypchar.xor("Cnggd+\\dygo*", 11, "utf8"); // "Hello World!"
crypchar.not("Hello World!"); // <Buffer b7 9a 93 93 90 df a8 90 8d 93 9b de>
crypchar.not(Buffer.of(183, 154, 147, 147, 144, 223, 168, 144, 141, 147, 155, 222), "utf8"); // "Hello World!"
```

## Documentation
The documentation can be found [here](https://crackabottle.js.org/crypchar).

## License
This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for more details.
68 changes: 68 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"name": "crypchar",
"version": "1.0.0",
"description": "Encryption and decryption of characters using arithmetic operations.",
"main": "cjs/index.js",
"module": "esm/index.mjs",
"types": "types/index.d.ts",
"exports": {
".": {
"types": "./types/index.d.ts",
"import": "./esm/index.mjs",
"require": "./cjs/index.js"
},
"./*": {
"types": "./types/*.d.ts",
"import": "./esm/*.mjs",
"require": "./cjs/*.js"
}
},
"repository": {
"type": "git",
"url": "git+https://github.com/crack-a-bottle/crypchar.git"
},
"files": [
"cjs",
"esm",
"types"
],
"scripts": {
"build": "tsup && tsc --emitDeclarationOnly --types node",
"build:docs": "typedoc src/index.ts --includeVersion",
"test": "mocha",
"lint": "prettier . -c",
"prepare": "pnpm build"
},
"homepage": "https://crackabottle.js.org/crypchar",
"keywords": [
"crypchar",
"crypto",
"characters",
"encryption",
"decryption",
"arithmetic",
"operations",
"and",
"xor",
"nor",
"nand",
"xnor",
"not",
"or",
"byte",
"bit",
"bitwise"
],
"author": "hiimjustin000",
"license": "MIT",
"devDependencies": {
"@types/mocha": "^10.0.1",
"@types/node": "^18.16.0",
"mocha": "^10.2.0",
"prettier": "^2.8.8",
"ts-node": "^10.9.1",
"tsup": "^6.7.0",
"typedoc": "^0.24.6",
"typescript": "^5.0.4"
}
}
Loading

0 comments on commit fe078cc

Please sign in to comment.