Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gw2e-chat-codes

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gw2e-chat-codes

Encode and decode Guild Wars 2 chat codes

  • 1.4.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
567
decreased by-8.4%
Maintainers
1
Weekly downloads
 
Created
Source

chat-codes

Build Status Coverage Status

Encode and decode Guild Wars2 chat codes

This is part of gw2efficiency. Please report all issues in the central repository.

Install

npm install gw2e-chat-codes

This module can be used for Node.js as well as browsers using Browserify.

Usage

const { encode, decode } = require('gw2e-chat-codes')

// Encode a type and id as a chat code
// Valid types are item, map, skill, trait, recipe, skin, outfit & objective
let encodedSkill = encode('skill', 5842)
// -> '[&BtIWAAA=]'

// You can pass an object as second parameter to also encode quantity, skin or upgrades
let encodedItem = encode('item', {id: 46762, quantity: 10, skin: 5807, upgrades: [24554, 24615]})
// -> '[&AgGqtgDgrxYAAOpfAAAnYAAA]'

// Decode a chat code into type and id
let decodedCode = decode('[&BtIWAAA=]')
// -> {type: 'skin', id: 5842}

Tests

npm test

Licence

MIT

Big thanks to codemasher & poke, who wrote this algorithm in PHP, and darthmaim who wrote most of the build template link code.

FAQs

Package last updated on 06 Sep 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc