Observed since 20 Oct, 20:50 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
6bit-encoder
Encodes 6bit numbers (0..63) to URL safe chars.
Encodes 6bit numbers (0..63) to URL safe chars.
const assert = require('assert')
const { encode, encode5, decode, decode5 } = require('6bit-encoder')
assert.equal(encode(0b001111), 'F')
assert.equal(encode5(0b011111011111011111011111011111), 'VVVVV')
assert.equal(decode('F'), 0b001111)
assert.equal(decode5('VVVVV'), 0b011111011111011111011111011111)
npm install 6bit-encoder
Table of Contents generated with DocToc
A URL safe char that is not part of the encoding table and
can be used as a separator: '*'
Type: String
Remaining URL safe chars that are not part of the encoding table and
can be used as a separator: ; , . ~ ( ' ) ! * : @
Decodes one char into a 6 bit number
Parameters
s String the char to decodeReturns Number a 6 bit number
Decodes two chars into a 12 bit number
Parameters
s String the chars to decodeReturns Number a 12 bit number
Decodes three chars into an 18 bit number
Parameters
s String the chars to decodeReturns Number an 18 bit number
Decodes four chars into an 24 bit number
Parameters
s String the chars to decodeReturns Number a 24 bit number
Decodes five chars into an 30 bit number
Parameters
s String the chars to decodeReturns Number a 30 bit number
Encodes a 6 bit number into a URL safe char
Parameters
n Number a 6 bit numberReturns String the char
Encodes a 12 bit number into two URL safe chars
Parameters
n Number a 12 bit numberReturns String the chars
Encodes a 18 bit number into three URL safe chars
Parameters
n Number a 18 bit numberReturns String the chars
Encodes a 24 bit number into four URL safe chars
Parameters
n Number a 24 bit numberReturns String the chars
Encodes a 30 bit number into five URL safe chars
Parameters
n Number a 30 bit numberReturns String the chars
Get a decode function to decode n chars
Parameters
n Number the number of chars to decodeReturns function the matching decoding function
Get an encode function to encode an n * 6 bit number
Parameters
n Number number of 6 bits to encodeReturns function the matching encoding function
MIT
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
tapeEnvironment{
"local_name": "tape",
"alias": false,
"peer_metadata": null
} | ~4.8.0 | development |
Source distribution
{
"shasum": "032af94dba075e0345225fb6d541a5a9d773191b",
"tarball": "https://registry.npmjs.org/6bit-encoder/-/6bit-encoder-0.1.0.tgz",
"integrity": "sha512-gGyQlgofVqhflU8z3cezBl3LlJ5+8FGa//0HCqFWbRJg9uqfO42njDL150kqDNnmH9kznBQeQ88CPNBDQyn/NA==",
"signatures": [
{
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
"sig": "MEQCIFgkwluKBqs2qwaNULVvf4d/r5FxLGxnOifv2Cf8WOxTAiAotATzElwwjDxBVQQRFg5n0dF6qjavYRuNXLlX6S9msQ=="
}
]
}Observed since 20 Oct, 20:50 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:36f21f7b45e58b1e88be03daeeb796c782808b82e2f20563ea7bd3aba0dbfe00