Socket
Socket
Sign inDemoInstall

runeterra

Package Overview
Dependencies
0
Maintainers
5
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    runeterra

Legends of Runeterra deck code encoder/decoder


Version published
Weekly downloads
26
increased by420%
Maintainers
5
Install size
32.4 kB
Created
Weekly downloads
 

Readme

Source

runeterra

JavaScript port of the RiotGames/LoRDeckCodes library, made for encoding and decoding Legends of Runeterra card decks. Below is an example code for the Warmother Control deck by prohibit_hb on Mobalytics.

CEBAIAIFAEHSQNQIAEAQGDAUDAQSOKJUAIAQCBI5AEAQCFYA

Install

npm install runeterra

Cards, decks and how to encode them

If you want to understand the process of the encoding and decoding decks, please refer to the original library, as Riot has done a great job explaining it there.

Usage

const { DeckEncoder } = require('runeterra')

const deck = DeckEncoder.decode('CEAAECABAQJRWHBIFU2DOOYIAEBAMCIMCINCILJZAICACBANE4VCYBABAILR2HRL')
/*
[ Card { code: '01PZ019', count: 2 },
  Card { code: '01PZ027', count: 2 },
  Card { code: '01PZ028', count: 2 },
  Card { code: '01PZ040', count: 2 },
  Card { code: '01PZ045', count: 2 },
  Card { code: '01PZ052', count: 2 },
  Card { code: '01PZ055', count: 2 },
  Card { code: '01PZ059', count: 2 },
  Card { code: '01IO006', count: 2 },
  Card { code: '01IO009', count: 2 },
  Card { code: '01IO012', count: 2 },
  Card { code: '01IO018', count: 2 },
  Card { code: '01IO026', count: 2 },
  Card { code: '01IO036', count: 2 },
  Card { code: '01IO045', count: 2 },
  Card { code: '01IO057', count: 2 },
  Card { code: '01PZ013', count: 1 },
  Card { code: '01PZ039', count: 1 },
  Card { code: '01PZ042', count: 1 },
  Card { code: '01PZ044', count: 1 },
  Card { code: '01IO023', count: 1 },
  Card { code: '01IO029', count: 1 },
  Card { code: '01IO030', count: 1 },
  Card { code: '01IO043', count: 1 } ]
*/

// Card
deck[0].code    // "01PZ019"
deck[0].count   // 2
deck[0].set     // 1
deck[0].id      // 19
deck[0].faction // Faction { id: 4, shortCode: "PZ" }

const code = DeckEncoder.encode(deck)
// CEAAECABAQJRWHBIFU2DOOYIAEBAMCIMCINCILJZAICACBANE4VCYBABAILR2HRL

Keywords

FAQs

Last updated on 16 May 2022

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc