Skip to content

Commit

Permalink
Port: Encoder + Decoder modules (#4)
Browse files Browse the repository at this point in the history
* [port] implement decoder and encoder

* [port] add test

* set default prettier config

* [port] add dependencies
  • Loading branch information
beesaferoot authored May 10, 2024
1 parent 8476080 commit fb8b2e8
Show file tree
Hide file tree
Showing 11 changed files with 781 additions and 49 deletions.
8 changes: 8 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"semi": false,
"trailingComma": "es5",
"singleQuote": true,
"tabWidth": 4,
"useTabs": false
}

78 changes: 78 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,8 @@
"engines": {
"node": ">=18.19.0"
},
"type": "module"
"dependencies": {
"buffer": "^6.0.3",
"siphash24": "^1.3.1"
}
}
22 changes: 10 additions & 12 deletions src/constants.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@

const ADD_TIME = 1
const SET_TIME = 2
const SET_TIME = 2
const DISABLE_PAYG = 3
const COUNTER_SYNC = 4
const INVALID = 10
const ALREADY_USED = 11


module.exports = {
TokenTypes: {
ADD_TIME,
SET_TIME,
DISABLE_PAYG,
COUNTER_SYNC,
INVALID,
ALREADY_USED
}
}
TokenTypes: {
ADD_TIME,
SET_TIME,
DISABLE_PAYG,
COUNTER_SYNC,
INVALID,
ALREADY_USED,
},
}
Loading

0 comments on commit fb8b2e8

Please sign in to comment.