1.4.2 • Published 8 months ago

gw2e-chat-codes v1.4.2

Weekly downloads
3
License
MIT
Repository
github
Last release
8 months ago

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.

1.4.2

8 months ago

1.4.1

8 months ago

1.4.0

8 months ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago