
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
6bit-encoder
Advanced tools
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
FAQs
Encodes 6bit numbers (0..63) to URL safe chars.
The npm package 6bit-encoder receives a total of 11 weekly downloads. As such, 6bit-encoder popularity was classified as not popular.
We found that 6bit-encoder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.