Skip to content

Go package to calculate unlock codes for Huawei devices

License

Notifications You must be signed in to change notification settings

kenshaw/huaweihash

Repository files navigation

About huaweicalc

Package huaweicalc provides a simple Go package to calculate the unlock codes for a Huawei device. These are used for flashing the firmware to different versions.

Originally, I was planning to rewrite all the hash calculations to Go, but gave up on the v2 and v201 algorithms. As such, I merely imported the C code from forth32's GitHub repository

Installation

Install in the usual way:

$ go get -u github.com/kenshaw/huaweihash

Command-Line Util

There is a command line tool that uses the package to easily generate the flash, v1, v2, and v202 codes:

$ go get -u github.com/kenshaw/huaweihash/cmd/huaweicalc
$ huaweicalc -imei 868757025499999
{
  "flash": "50702788",
  "v1": "48125080",
  "v2": "39842371",
  "v201": "46863554"
}

About

Go package to calculate unlock codes for Huawei devices

Resources

License

Stars

Watchers

Forks

Packages

No packages published