Socket
Book a DemoInstallSign in
Socket

lxiv

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lxiv

A compact library to encode and decode base64 data.

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

lxiv - A compact library to encode and decode base64 data in JavaScript.

lxiv is a compact library to encode and decode base64 data in JavaScript using arbitrary sources and destinations through the use of successively called functions, basically eliminating memory overhead.

API

encode(src, dst)

Encodes bytes to base64 char codes.

ParameterTypeDescription
srcfunction():(number | null)Bytes source as a function returning the next byte respectively null if there are no more bytes left.
dstfunction(number)Characters destination as a function successively called with each encoded char code.

decode(src, dst)

Decodes base64 char codes to bytes.

ParameterTypeDescription
srcfunction():(number | null)Characters source as a function returning the next char code respectively null if there are no more characters left.
dstfunction(number)Bytes destination as a function successively called with the next byte.
@throwsErrorIf a character code is invalid

test(str)

Tests if a string is valid base64.

ParameterTypeDescription
strstringString to test
@returnsbooleantrue if valid, otherwise false

Downloads

  • Distributions

License

Apache License, Version 2.0

Keywords

encoding

FAQs

Package last updated on 12 Jul 2014

Did you know?

Socket

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.

Install

Related posts