SkillAgentSearch skills...

Packbits

PackBits implementation in JavaScript.

Install / Use

/learn @fiahfy/Packbits
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<!-- markdownlint-disable MD024 -->

packbits

badge

PackBits implementation in JavaScript.

Installation

npm install @fiahfy/packbits

Usage

Default

Encoding

import { encode } from '@fiahfy/packbits'

console.log(buf) // <Buffer aa bb bb cc cc cc dd dd dd dd>
const encoded = encode(buf)
console.log(encoded) // <Buffer 00 aa ff bb fe cc fd dd>

Decoding

import { decode } from '@fiahfy/packbits'

console.log(buf) // <Buffer 00 aa ff bb fe cc fd dd>
const decoded = decode(buf)
console.log(decoded) // <Buffer aa bb bb cc cc cc dd dd dd dd>

ICNS format

In Apple Icon Image format, pixel data are often compressed (per channel) with a format similar to PackBits.

Encoding

import { encode } from '@fiahfy/packbits'

console.log(buf) // <Buffer aa bb bb cc cc cc dd dd dd dd>
const encoded = encode(buf, { format: 'icns' })
console.log(encoded) // <Buffer 02 aa bb bb 80 cc 81 dd>

Decoding

import { decode } from '@fiahfy/packbits'

console.log(buf) // <Buffer 02 aa bb bb 80 cc 81 dd>
const decoded = decode(buf, { format: 'icns' })
console.log(decoded) // <Buffer aa bb bb cc cc cc dd dd dd dd>

Related Skills

View on GitHub
GitHub Stars4
CategoryDevelopment
Updated3y ago
Forks0

Languages

TypeScript

Security Score

75/100

Audited on May 4, 2022

No findings