radiocodecalculator

package module
v0.0.0-...-baedd54 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

README

Radio Code Calculator Online & SDK for Go

Radio Code Calculator is an online service along with Web API & SDK for generating car radio unlock codes for popular vehicle brands.

Following a breakdown or a disconnection of the car battery, most of the vehicle radio & navigation units will ask for an unlocking code. It's standard anti-theft protection.

Our car Radio Code Calculator allows you to generate 100% valid radio codes to unlock car radios & navigation without the need to use the expensive service of authorized dealers.

Radio Code Calculator

The service is available through a simple online interface and Web API, with multiple SDK development libraries for popular programming languages.

Thanks to our solution, you can create, for instance, mobile or web applications that allow for easy generation of radio codes.

Supported car models and radios

Our service is being continuously developed and new algorithms are gradually added for new car models and their radios.

If a new algorithm is added, you will get automatic and free access to it as part of your current license.

Individual calculators are available on our site as a paid service for end customers. You can verify them and see lists of supported radios on the relevant subpages:

Use of radio code calculator

Where and who can use the radio code generation service and make money from code generation?

Android App developers

The main audience for our software is clearly developers and programmers, either of mobile or desktop applications.

Shoping cart Online stores

If you run an online e-commerce store, you can sell radio codes through it using our software solutions.

Car Auto repair shops

We also encourage car repair shops whose customers often use car radio unlocking services.

Person Private individuals

Private individuals will also profit from our solution by generating codes and selling them on car forums or auction sites such as eBay, Craigslist.

No limits!

You can generate codes without limitation with your purchased one year license.

Set your own price for generating a single code and start earning by using tried and tested algorithms from a programming language you know.

If you are not a programmer - don't worry. Just use our online calculator.

Installation

The preferred way to install the Web API SDK is via Go modules.

go get github.com/PELock/Radio-Code-Calculator-Go

The module path is github.com/PELock/Radio-Code-Calculator-Go.

Packages for other programming languages

The installation packages have been uploaded to repositories for several popular programming languages and their source codes have been published on GitHub:

Repository Language Installation Package GitHub
Packagist repository for PHP and Composer PHP Add the following line to require section of your composer.json file "pelock/radio-code-calculator": "*" Packagist Sources
PyPI repository for Python Python Run pip install radio-code-calculator PyPi Sources
NPM repository for JavaScript and TypeScript JavaScript, TypeScript Run npm i radio-code-calculator or add the following to dependencies section of your package.json file "dependencies": { "radio-code-calculator": "latest" }, NPM Sources

Usage examples

Example — list/main.go
/******************************************************************************
 * Radio Code Calculator API usage example.
 *
 * Version      : v1.1.6
 * Language     : Go
 * Author       : Bartosz Wójcik
 * Homepage     : https://www.pelock.com
 *
 *****************************************************************************/

package main

import (
	"context"
	"fmt"
	"os"

	radiocodecalculator "github.com/PELock/Radio-Code-Calculator-Go"
)

func main() {
	client := radiocodecalculator.New("ABCD-ABCD-ABCD-ABCD")
	errCode, models, err := client.List(context.Background())
	if err != nil {
		fmt.Fprintln(os.Stderr, err)
		os.Exit(1)
	}
	if errCode != radiocodecalculator.ErrorSuccess {
		fmt.Printf("Error code %d\n", errCode)
		os.Exit(1)
	}
	for _, m := range models {
		fmt.Printf("%s serial_len=%d extra_len=%d\n", m.Name, m.SerialMaxLen, m.ExtraMaxLen)
	}
}
Example — login/main.go
/******************************************************************************
 * Radio Code Calculator API usage example.
 *
 * Version      : v1.1.6
 * Language     : Go
 * Author       : Bartosz Wójcik
 * Homepage     : https://www.pelock.com
 *
 *****************************************************************************/

package main

import (
	"context"
	"fmt"
	"os"

	radiocodecalculator "github.com/PELock/Radio-Code-Calculator-Go"
)

func main() {
	client := radiocodecalculator.New("ABCD-ABCD-ABCD-ABCD")
	errCode, result, err := client.Login(context.Background())
	if err != nil {
		fmt.Fprintln(os.Stderr, err)
		os.Exit(1)
	}
	if errCode != radiocodecalculator.ErrorSuccess {
		fmt.Printf("Error code %d\n", errCode)
		os.Exit(1)
	}
	license, _ := result["license"].(map[string]any)
	fmt.Println("License activation status -", license["activationStatus"])
	fmt.Println("License owner -", license["userName"])
	fmt.Println("License type -", license["type"])
	fmt.Println("Expiration date -", license["expirationDate"])
}
Example — offline/main.go
/******************************************************************************
 * Radio Code Calculator API usage example.
 *
 * Version      : v1.1.6
 * Language     : Go
 * Author       : Bartosz Wójcik
 * Homepage     : https://www.pelock.com
 *
 *****************************************************************************/

package main

import (
	"fmt"

	radiocodecalculator "github.com/PELock/Radio-Code-Calculator-Go"
)

func main() {
	model := radiocodecalculator.FordMSeries
	fmt.Println("valid 123456 ->", model.Validate("123456", ""))
	fmt.Println("bad length ->", model.Validate("123", ""))
	fmt.Println("bad pattern ->", model.Validate("ABCDEF", ""))
}
Example — simple/main.go
/******************************************************************************
 * Radio Code Calculator API usage example.
 *
 * Version      : v1.1.6
 * Language     : Go
 * Author       : Bartosz Wójcik
 * Homepage     : https://www.pelock.com
 *
 *****************************************************************************/

package main

import (
	"context"
	"fmt"
	"os"

	radiocodecalculator "github.com/PELock/Radio-Code-Calculator-Go"
)

func main() {
	client := radiocodecalculator.New("ABCD-ABCD-ABCD-ABCD")
	errCode, result, err := client.Calc(context.Background(), radiocodecalculator.FordMSeries, "123456", "")
	if err != nil {
		fmt.Fprintln(os.Stderr, err)
		os.Exit(1)
	}
	switch errCode {
	case radiocodecalculator.ErrorSuccess:
		fmt.Println("Radio code is", result["code"])
	case radiocodecalculator.ErrorInvalidLicense:
		fmt.Println("Invalid license key!")
	default:
		fmt.Printf("Error code %d\n", errCode)
	}
}

See the examples/ directory in this repository for complete samples.

Got questions?

If you are interested in the Radio Code Calculator Web API or have any questions regarding radio code generator SDK packages, technical or legal issues, or if something is not clear, please contact me. I'll be happy to answer all of your questions.

Bartosz Wójcik

Documentation

Index

Constants

View Source
const (
	ErrorConnection                = -1
	ErrorSuccess                   = 0
	ErrorInvalidInput              = 1
	ErrorInvalidCommand            = 2
	ErrorInvalidRadioModel         = 3
	ErrorInvalidSerialLength       = 4
	ErrorInvalidSerialPattern      = 5
	ErrorInvalidSerialNotSupported = 6
	ErrorInvalidExtraLength        = 7
	ErrorInvalidExtraPattern       = 8
	ErrorInvalidLicense            = 100
)
View Source
const APIURL = "https://www.pelock.com/api/radio-code-calculator/v1"

Variables

View Source
var (
	RenaultDacia          = NewRadioModel("renault-dacia", 4, `^([A-Z]{1}[0-9]{3})$`, 0, nil)
	ChryslerPanasonicTM9  = NewRadioModel("chrysler-panasonic-tm9", 4, `^([0-9]{4})$`, 0, nil)
	ChryslerDodgeVP       = NewRadioModel("chrysler-dodge-vp", 4, `^([a-zA-Z0-9]{4})$`, 0, nil)
	FordMSeries           = NewRadioModel("ford-m-series", 6, `^([0-9]{6})$`, 0, nil)
	FordVSeries           = NewRadioModel("ford-v-series", 6, `^([0-9]{6})$`, 0, nil)
	FordTravelpilot       = NewRadioModel("ford-travelpilot", 7, `^([0-9]{7})$`, 0, nil)
	FiatStiloBravoVisteon = NewRadioModel("fiat-stilo-bravo-visteon", 6, `^([a-zA-Z0-9]{6})$`, 0, nil)
	FiatDaiichi           = NewRadioModel("fiat-daiichi", 4, `^([0-9]{4})$`, 0, nil)
	FiatVP                = NewRadioModel("fiat-vp", 4, `^([0-9]{4})$`, 0, nil)
	ToyotaERC             = NewRadioModel("toyota-erc", 16, `^([a-zA-Z0-9]{16})$`, 0, nil)
	JeepCherokee          = NewRadioModel("jeep-cherokee", 14, `^([a-zA-Z0-9]{10}[0-9]{4})$`, 0, nil)
	NissanGloveBox        = NewRadioModel("nissan-glove-box", 12, `^([a-zA-Z0-9]{12})$`, 0, nil)
	EclipseESN            = NewRadioModel("eclipse-esn", 6, `^([a-zA-Z0-9]{6})$`, 0, nil)
	JaguarAlpine          = NewRadioModel("jaguar-alpine", 5, `^([0-9]{5})$`, 0, nil)
)

Built-in offline validation templates (PHP SDK patterns; Eclipse ESN name fixed).

Functions

This section is empty.

Types

type Client

type Client struct {
	APIKey     string
	APIURL     string
	UserAgent  string
	HTTPClient *http.Client
}

Client is the Radio Code Calculator Web API client.

func New

func New(apiKey string) *Client

New creates a client. The activation key cannot be empty for a full license.

func (*Client) Calc

func (c *Client) Calc(ctx context.Context, radioModel any, serial, extra string) (int, map[string]any, error)

Calc generates a radio code. radioModel may be a string or *RadioModel.

func (*Client) Info

func (c *Client) Info(ctx context.Context, radioModel any) (int, *RadioModel, error)

Info returns calculator parameters for one model.

func (*Client) List

func (c *Client) List(ctx context.Context) (int, []*RadioModel, error)

List returns every supported calculator.

func (*Client) Login

func (c *Client) Login(ctx context.Context) (int, map[string]any, error)

Login returns (errorCode, raw JSON map).

type RadioModel

type RadioModel struct {
	Name                string
	SerialMaxLen        int
	SerialRegexPatterns map[string]string
	ExtraMaxLen         int
	ExtraRegexPatterns  map[string]string
	DefaultLanguage     string
}

RadioModel describes one calculator (name, lengths, regex patterns).

func NewRadioModel

func NewRadioModel(name string, serialMaxLen int, serialRegex any, extraMaxLen int, extraRegex any) *RadioModel

NewRadioModel builds a model. serialRegex / extraRegex may be a string or map[string]string.

func (*RadioModel) ExtraRegexPattern

func (m *RadioModel) ExtraRegexPattern() string

ExtraRegexPattern returns the extra-field regex, or "" if unused.

func (*RadioModel) SerialRegexPattern

func (m *RadioModel) SerialRegexPattern() string

SerialRegexPattern returns the regex for the default language (PCRE slashes stripped).

func (*RadioModel) Validate

func (m *RadioModel) Validate(serial string, extra string) int

Validate checks serial / extra length and regex offline.

Directories

Path Synopsis
examples
list command
login command
offline command
simple command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL