GRB1
application/x-grib
Magic Bytes
Offset: 0
47 52 49 42
GRB1 is the legacy first edition of the General Regularly-distributed Information in Binary form (GRIB) standard, established by the World Meteorological Organization. This binary format is primarily used by meteorological centers worldwide to store and transmit gridded historical and forecast weather data. Although largely superseded by the more flexible GRIB2 standard for modern applications, this specific version remains prevalent within older climatological archives and legacy systems.
Validation Code
How to validate .grb1 files in Python
Python
def is_grb1(file_path: str) -> bool:
"""Check if file is a valid GRB1 by magic bytes."""
signature = bytes([0x47, 0x52, 0x49, 0x42])
with open(file_path, "rb") as f:
return f.read(4) == signature
How to validate .grb1 files in Node.js
Node.js
function isGRB1(buffer: Buffer): boolean {
const signature = Buffer.from([0x47, 0x52, 0x49, 0x42]);
return buffer.subarray(0, 4).equals(signature);
}
Go
func IsGRB1(data []byte) bool {
signature := []byte{0x47, 0x52, 0x49, 0x42}
if len(data) < 4 {
return false
}
return bytes.Equal(data[:4], signature)
}
API Endpoint
GET
/api/v1/grb1
curl https://filesignature.org/api/v1/grb1