synchsafe
TypeScript icon, indicating that this package has built-in type declarations

9.0.4 • Public • Published

synchsafe

A module to decode and encode synchsafe integers.

version

This module provides two functions to decode and encode synchsafe integers as it is for example required by the ID3 standard. It is a fork of this Gist by raym.

Usage

The synchsafe module is available on npm and can be installed as usual.

npm install synchsafe

You can then import its public functions decode() and encode() like this:

import { decode, encode } from 'synchsafe';

As you might guess, the encode() function turns a regular integer into a synchsafed integer and the decode() function does the opposite. Therefore the following line would evaluate to true.

decode(encode(30201)) === 30201;

Readme

Keywords

none

Package Sidebar

Install

npm i synchsafe

Weekly Downloads

93

Version

9.0.4

License

MIT

Unpacked Size

11.9 kB

Total Files

11

Last publish

Collaborators

  • chrisguttandin