Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@kalin-setterberg/encoding
Advanced tools
Helpers for decoding or encoding BASE64 and UTF-8 in any execution context.
Readme
JS functions for working with encodings. Contains typings for TypeScript.
All data are processed using Uint8Array
s.
In a node-like context you may encode a Buffer
but the return value will be a plain Uint8Array
.
import { b64enc } from "@kalin-setterberg/encoding";
const useBase64url = true;
const data = new Uint8Array([104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100]);
/** @type {Uint8Array} */
const result = b64enc(data, useBase64url);
Prefers the use of a globally defined TextEncoder
following the WHATWG standard.
If no TextEncoder
is defined but there is a global Buffer
, as in node, a Buffer
will be used for encoding.
Falls back upon a custom implementation supporting up to 16 bit code points.
import { utf8enc } from "@kalin-setterberg/encoding";
const data = "hello world";
/** @type {Uint8Array} */
const result = utf8enc(data);
Prefers the use of a globally defined TextDecoder
following the WHATWG standard.
If no TextDecoder
is defined but there is a global Buffer
, as in node, Buffer.toString()
will be used for decoding when the parameter is an instance of Buffer
.
Falls back upon a custom implementation supporting up to 16 bit code points.
import { utf8dec } from "@kalin-setterberg/encoding";
const data = new Uint8Array([104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100]);
/** @type {string} */
const result = utf8dec(data);
FAQs
Helpers for decoding or encoding BASE64 and UTF-8 in any execution context.
The npm package @kalin-setterberg/encoding receives a total of 0 weekly downloads. As such, @kalin-setterberg/encoding popularity was classified as not popular.
We found that @kalin-setterberg/encoding 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.