Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/art-emini/easytoken
Create a token that can be used for anything!
https://github.com/art-emini/easytoken
characters ids random random-ids random-name random-tokens tokens
Last synced: about 2 months ago
JSON representation
Create a token that can be used for anything!
- Host: GitHub
- URL: https://github.com/art-emini/easytoken
- Owner: art-emini
- License: other
- Created: 2020-11-28T02:04:46.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-03-12T12:50:56.000Z (almost 4 years ago)
- Last Synced: 2024-09-15T14:47:35.640Z (4 months ago)
- Topics: characters, ids, random, random-ids, random-name, random-tokens, tokens
- Language: JavaScript
- Homepage:
- Size: 694 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# EasyToken
### EasyToken allows you to create a simple 16 character token that can be used for anything!
### NPM: https://www.npmjs.com/package/@ksplat/easytoken
## Features
### 1. Allows you to write and store the tokens in a file!
### 2. Set lifetimes on your tokens so they get removed from your file after a certain time!
### 3. Select what characters are allowed in your token!## Example
```js
const EasyToken = require("../EasyToken");
var options = {
// The file where the token will be written too. Starts from the root. Must b e a textfile. (OPTIONAL)
database: "test/test.txt",// The characters that are allowed in the token. Put ABC for letters, 123 for numbers, or ABC123 for both.
characters: "ABC123",// How long the token will last for in the database in milliseconds. Takes #, and "Infinite" (OPTIONAL, ONLY WORKS IF YOU LISTED A "DATABASE"(textfile))
lifetime: 5000,// A boolean to determine if you want the result to be stored and return as a base64 encoded string. (OPTIONAL)
base64Encode: false,// A boolean to determine if you want the token to be broken up into 4 parts, only works if length is an even number. (OPTIONAL)
chunked: true,// A number to determine the size of the each chunk. Only works if chunked = true. (OPTIONAL)
chunkSize: 3,// The length of your token, returns a 16 digit token if not defined. **Only works correctly if base64Encode is false** (OPTIONAL)
length: 12
};EasyToken.createToken(options, (token) => {
console.log(token)
});// takes one parameter which determines if you want numbers(123) or letters(ABC)
console.log(EasyToken.createShort("ABC"));
```