Skip to content
This repository has been archived by the owner on Apr 29, 2023. It is now read-only.
/ block95 Public archive

🧐 Encode binary data to valid ASCII data.

License

Notifications You must be signed in to change notification settings

PoneyClairDeLune/block95

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

block95

🧐 Encode binary data with 9 on 11 base 95 block encoding.

This project is a response to How the Great Firewall of China Detects and Blocks Fully Encrypted Traffic, as the encoding scheme used in the project...

  • Get all bytes to be printable.
  • Has the ratio of total 1s among all bits fluctuates around 47.5%, if input can be considered fully random.

API

Block95

.encodeLength(length)

Estimate encode length.

.decodeLength(length)

Estimate decode length.

.encodeBlock(inputSlice, outputSlice)

Encode a 9-byte (or less) block.

.decodeBlock(inputSlice, outputSlice)

Decode a 11-byte (or less) block.

.encodeBytes(inputBuffer, outputBuffer)

Encode Uint8Array.

.decodeBytes(inputBuffer, outputBuffer)

Decode Uint8Array.

.encodeSync(inputBuffer, outputBuffer)

Encode any of ArrayBuffer or TypedArray.

.decodeSync(inputBuffer, outputBuffer)

Encode any of ArrayBuffer or TypedArray.

.encode(inputBuffer, outputBuffer)

Async version of .encodeSync.

.decode(inputBuffer, outputBuffer)

Async version of .decodeSync.