The Go implementation of Flash Detector
Chinese version: README.zh-CN.md
This repository provides:
- A Go library for decoding flash part numbers (
flashdecoder.Decode(partNumber)). - A Go library for decoding flash IDs (
flashdecoder.DecodeID(idHex)). - FDB helper APIs (
flashdecoder.FindFdb,flashdecoder.SearchFdb,flashdecoder.GetFdbSummary). - A small CLI entry in
bin/as a demo/utility.
Run directly:
go run ./bin --part NW383
go run ./bin --part NW383 --json
go run ./bin --id EC-D7-94-7E
go run ./bin --search NW101 --limit 5
go run ./bin --summaryInstall the CLI:
go install ./binThen run (binary name follows the folder name, typically bin):
bin --part NW383package main
import (
"fmt"
flashdecoder "flashDecoder"
)
func main() {
info, err := flashdecoder.Decode("NW383")
if err != nil {
// Unsupported or not found; `info` may still contain partial fields.
fmt.Println("decode error:", err)
}
fmt.Println("Vendor:", info.Vendor)
fmt.Println("Type:", info.Type)
fmt.Println("Capacity:", info.Capacity)
}decoder.go: public API entry (Decode)flashs/: vendor-specific decodersutils/: helpers +mdb.jsonloaderbin/: CLI demo entry