Gathering detailed insights and metrics for token-types
Gathering detailed insights and metrics for token-types
Gathering detailed insights and metrics for token-types
Gathering detailed insights and metrics for token-types
@terrazzo/token-tools
Various utilities for token types
ms-token
utils for makeomatic mservice for encoding/decoding various token types and storing associated metadata with them
@azure/msal-node
Microsoft Authentication Library for Node
@octokit/auth-oauth-user
Octokit authentication strategy for OAuth clients
A primitive token library used to read from, and to write a node Buffer
npm install token-types
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
11 Stars
663 Commits
8 Forks
3 Watching
15 Branches
4 Contributors
Updated on 09 Aug 2024
TypeScript (100%)
Cumulative downloads
Total Downloads
Last day
-1.7%
983,487
Compared to previous day
Last week
4.9%
5,225,294
Compared to previous week
Last month
9.3%
21,612,671
Compared to previous month
Last year
44.8%
216,752,702
Compared to previous year
2
21
A primitive token library used to read and write from a Uint8Array
.
Although it is possible to use this module directly, it is primarily designed to be used with strtok3 tokenizer.
Module: version 5 migrated from CommonJS to pure ECMAScript Module (ESM). JavaScript is compliant with ECMAScript 2019 (ES10).
1npm install --save token-types
Usually in combination with strtok3:
1npm install --save strtok3
Using TypeScript you should also install @tokenizer/token as a development dependency:
1npm install --save-dev @tokenizer/token
1import * as strtok3 from 'strtok3'; 2import * as token from 'token-types'; 3 4(async () => { 5 6 const tokenizer = await strtok3.fromFile("somefile.bin"); 7 try { 8 const myNumber = await tokenizer.readToken(token.Float32_BE); 9 console.log(`My number: ${myNumber}`); 10 } finally { 11 tokenizer.close(); // Close the file 12 } 13})();
token-types
supports a wide variety of numeric tokens out of the box:
Token | Number | Bits | Endianness |
---|---|---|---|
UINT8 | Unsigned integer | 8 | n/a |
UINT16_BE | Unsigned integer | 16 | big endian |
UINT16_LE | Unsigned integer | 16 | little endian |
UINT24_BE | Unsigned integer | 24 | big endian |
UINT24_LE | Unsigned integer | 24 | little endian |
UINT32_BE | Unsigned integer | 32 | big endian |
UINT32_LE | Unsigned integer | 32 | little endian |
UINT64_BE | Unsigned integer | 64 | big endian |
UINT64_LE * | Unsigned integer | 64 | little endian |
INT8 | Signed integer | 8 | n/a |
INT16_BE | Signed integer | 16 | big endian |
INT16_LE | Signed integer | 16 | little endian |
INT24_BE | Signed integer | 24 | big endian |
INT24_LE | Signed integer | 24 | little endian |
INT32_BE | Signed integer | 32 | big endian |
INT32_LE | Signed integer | 32 | little endian |
INT64_BE | Signed integer | 64 | big endian |
INT64_LE * | Signed integer | 64 | little endian |
Float16_BE | IEEE 754 float | 16 | big endian |
Float16_LE | IEEE 754 float | 16 | little endian |
Float32_BE | IEEE 754 float | 32 | big endian |
Float32_LE | IEEE 754 float | 32 | little endian |
Float64_BE | IEEE 754 float | 64 | big endian |
Float64_LE | IEEE 754 float | 64 | little endian |
Float80_BE * | IEEE 754 float | 80 | big endian |
Float80_LE * | IEEE 754 float | 80 | little endian |
(*) The tokens exceed the JavaScript IEEE 754 64-bit Floating Point precision, decoding and encoding is best effort based.
StringType decoding is implemented using TextDecoder which supports a large number of encodings including but not limited to:
Check out the MDN web docs for the TextDecoder for a complete list
Custom tokens can be added, suitable for reading binary files or network messages:
1 ExtendedHeader = {
2 len: 10,
3
4 get: (buf, off) => {
5 return {
6 // Extended header size
7 size: Token.UINT32_BE.get(buf, off),
8 // Extended Flags
9 extendedFlags: Token.UINT16_BE.get(buf, off + 4),
10 // Size of padding
11 sizeOfPadding: Token.UINT32_BE.get(buf, off + 6),
12 // CRC data present
13 crcDataPresent: common.strtokBITSET.get(buf, off + 4, 31)
14 };
15 }
16 };
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
2 existing vulnerabilities detected
Details
Reason
SAST tool detected but not run on all commits
Details
Reason
Found 3/16 approved changesets -- score normalized to 1
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More